Avoid undefined behavior in pointer arithmetic in IE parsing
authorJouni Malinen <j@w1.fi>
Sat, 17 Oct 2015 23:22:34 +0000 (02:22 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 24 Oct 2015 18:43:54 +0000 (21:43 +0300)
commitb6f961ab25b7a76552b1970b78b1c5a12296808c
tree3f9d5f0404ba6c9685306503637e6776ef5100be
parent7b5880fcf4fa6b35880f0ed7bc63d73fb298bc55
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/common/ieee802_11_common.c