Avoid undefined behavior in pointer arithmetic in scan result IE parsing
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 08:52:32 +0000 (11:52 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 13:34:59 +0000 (15:34 +0200)
commit904e977bc79cc82c073cba8f36fae8b20bff2baf
tree32e5040e5cdbe783c9f63511f255440569811135
parentbdce45b83e3a6c393d8e576f6b432c0ebe83f605
Avoid undefined behavior in pointer arithmetic in scan result 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/scan.c