Avoid undefined behavior in pointer arithmetic in BSS IE parsing
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 08:43:24 +0000 (11:43 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 24 Oct 2015 18:43:54 +0000 (21:43 +0300)
commit1f32a239628b0062cecfed9ec902e244b64d238a
tree0b80cfbdfa8a49058de9e12b2cd606201a138b34
parent67fea55ca2a83df4451c4775a074c7ee033b5cb4
Avoid undefined behavior in pointer arithmetic in BSS 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>
wpa_supplicant/bss.c