fix undefined pointer arithmetic in CMSG_NXTHDR macro
authorRich Felker <dalias@aerifal.cx>
Sun, 22 May 2016 22:49:59 +0000 (18:49 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 22 May 2016 22:49:59 +0000 (18:49 -0400)
commit81fb75a1d75c20d97292cbbe4cde6a1e65871abe
tree71138623e144edd910490f327696b546e14f7d67
parent51eeb6ebc94d965768143c45e9f39b0a7998bdbd
fix undefined pointer arithmetic in CMSG_NXTHDR macro

previously, the only way the stopping condition could be met with
correct lengths in the headers invoked undefined behavior, adding
sizeof(struct cmsghdr) beyond the end of the cmsg buffer.

instead, compute and compare sizes rather than pointers.
include/sys/socket.h