nl80211: Avoid undefined behavior in pointer arithmetic
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 16:08:09 +0000 (19:08 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 13:35:00 +0000 (15:35 +0200)
commit336869f05a2e30c5400f8f63947b378f37562a75
tree65d5006025741fdfbfa14d19b490d07542be3a57
parent78c8ee488f0676b19daeda14a137ded9c56c1d8b
nl80211: Avoid undefined behavior in pointer arithmetic

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/drivers/driver_nl80211_scan.c