receiver: Avoid unaligned memory access in COOKIE verification

This access could be an issue on platforms with strict alignment
requirements.
This commit is contained in:
Tobias Brunner
2026-05-19 17:27:33 +02:00
parent 8f22345542
commit 7e7629499f
+1 -1
View File
@@ -281,7 +281,7 @@ static bool check_cookie(private_receiver_t *this, message_t *message)
IKE_HEADER_LENGTH + NOTIFY_PAYLOAD_HEADER_LENGTH +
sizeof(uint32_t) + this->hasher->get_hash_size(this->hasher) ||
*(data.ptr + 16) != PLV2_NOTIFY ||
*(uint16_t*)(data.ptr + IKE_HEADER_LENGTH + 6) != htons(COOKIE))
untoh16(data.ptr + IKE_HEADER_LENGTH + 6) != COOKIE)
{
/* no cookie found */
return FALSE;