AP: Avoid undefined behavior in pointer arithmetic in IE parsing
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 15:40:41 +0000 (18:40 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 13:34:59 +0000 (15:34 +0200)
commita5a2f252cb5b2813f146e036ae0adb0e5c02d35c
treede369b2ce5d375bc6da6691f589977fa0308eab5
parentde7fe64df5e3f90dd97767f835998bc1cbd8f56e
AP: Avoid undefined behavior in pointer arithmetic in IE parsing

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/beacon.c