EAP-IKEv2 server: Avoid undefined behavior in pointer arithmetic
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 08:23:44 +0000 (11:23 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 24 Oct 2015 18:43:54 +0000 (21:43 +0300)
commit0421d47e34da302c1ad84ebc4ecfac3d3a6fcd10
treeaadc8c338649fd28c1dc6662112b06a829e3861d
parent72bb05a0333f76135a079eee844c71eff740a6ed
EAP-IKEv2 server: 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/eap_server/ikev2.c