mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
NFC: Avoid misaligned read of an NDEF field
The 32-bit version of payload length field may not be 32-bit aligned in the message buffer, so use WPA_GET_BE32() to read it instead of ntohl(). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
e01281fccc
commit
fc880b11ed
@ -47,7 +47,7 @@ static int ndef_parse_record(const u8 *data, u32 size,
|
|||||||
} else {
|
} else {
|
||||||
if (size < 6)
|
if (size < 6)
|
||||||
return -1;
|
return -1;
|
||||||
record->payload_length = ntohl(*(u32 *)pos);
|
record->payload_length = WPA_GET_BE32(pos);
|
||||||
pos += sizeof(u32);
|
pos += sizeof(u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user