aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-07 12:33:55 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-07 13:25:06 (GMT)
commitfc880b11ed70ff9dcf8be48621f75d354cc5094d (patch)
tree5d09c159bf426fac6bbbef29bdc6bda7c564134e /src/wps
parente01281fccc666e121dc5846dad85327bae6e9517 (diff)
downloadhostap-fc880b11ed70ff9dcf8be48621f75d354cc5094d.zip
hostap-fc880b11ed70ff9dcf8be48621f75d354cc5094d.tar.gz
hostap-fc880b11ed70ff9dcf8be48621f75d354cc5094d.tar.bz2
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>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/ndef.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wps/ndef.c b/src/wps/ndef.c
index 8d1ce1e..5604b0a 100644
--- a/src/wps/ndef.c
+++ b/src/wps/ndef.c
@@ -47,7 +47,7 @@ static int ndef_parse_record(const u8 *data, u32 size,
} else {
if (size < 6)
return -1;
- record->payload_length = ntohl(*(u32 *)pos);
+ record->payload_length = WPA_GET_BE32(pos);
pos += sizeof(u32);
}