privsep: Avoid undefined behavior in pointer arithmetic
authorJouni Malinen <j@w1.fi>
Sun, 18 Oct 2015 16:08:25 +0000 (19:08 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 17:37:16 +0000 (19:37 +0200)
commitceb19ff7a67fc79721c1020a61933de18551891c
tree4c2696fc4157d8d57f92bb22c6e0d07a70e3928b
parent45a283e6d02f6863de496c1cc1110f494281e7c7
privsep: 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_privsep.c