Commit fd9fd568 authored by Pavel Emelyanov's avatar Pavel Emelyanov

test: Zeroify scm buffer before filling

The CMSG_NXTHDR checks the length of the __next__ cmsg, i.e. the one
that it is about to return for filling. Thus, keeping there anything
but zeroes is unsafe.
Reported-by: 's avatarPavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 5087faa0
...@@ -22,6 +22,7 @@ static int send_fd(int via, int fd1, int fd2) ...@@ -22,6 +22,7 @@ static int send_fd(int via, int fd1, int fd2)
char c = '\0'; char c = '\0';
int *fdp; int *fdp;
memset(buf, 0, sizeof(buf));
h.msg_control = buf; h.msg_control = buf;
h.msg_controllen = sizeof(buf); h.msg_controllen = sizeof(buf);
#ifdef SEPARATE #ifdef SEPARATE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment