Interworking: Avoid undefined behavior in pointer arithmetic
authorJouni Malinen <j@w1.fi>
Sat, 17 Oct 2015 22:37:38 +0000 (01:37 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 24 Oct 2015 18:43:54 +0000 (21:43 +0300)
commit67fea55ca2a83df4451c4775a074c7ee033b5cb4
tree9ec3490aadc04ac88ad1c01ef17010ecc0144ad1
parent3991cb7b3c6742d97c690970102ce35e1c45cd1e
Interworking: 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>
wpa_supplicant/interworking.c