sd-daemon: wipe out memory before using CMSG_NXTHDR()
authorDaniel Mack <daniel@zonque.org>
Mon, 12 Oct 2015 12:44:26 +0000 (14:44 +0200)
committerDaniel Mack <daniel@zonque.org>
Mon, 12 Oct 2015 13:15:25 +0000 (15:15 +0200)
commit40f44238924acf4e7a3ddfc1b0b1c111032bb43d
treec697af52c33ab9c3d64015fd6077b5b98d01e6a2
parent0a41d91f3022ae5107151ebd1af9b65a55030c7e
sd-daemon: wipe out memory before using CMSG_NXTHDR()

CMSG_NXTHDR() checks for cmsg->cmsg_len *after* it increased the pointer.
While this makes sense for parsing received messages, that's a pitfall
for code crafting messages with this macro.

Wipe out the allocated memory to fix this.
src/libsystemd/sd-daemon/sd-daemon.c