aboutsummaryrefslogtreecommitdiff
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2017-03-29 21:26:13 +0000
committerConrad Meyer <cem@FreeBSD.org>2017-03-29 21:26:13 +0000
commitebf1bc17689d41a835d5622d885b9541335e346f (patch)
tree222bbdf5c78074d28920758b3deb7e1e257c67ac /contrib/netbsd-tests
parent34a1b5b258f1f016e39f13d7ad8397b447a24e57 (diff)
downloadsrc-ebf1bc17689d41a835d5622d885b9541335e346f.tar.gz
src-ebf1bc17689d41a835d5622d885b9541335e346f.zip
t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow
msgsnd's msgsz argument is the size of the message following the 'long' message type. Don't include the message type in the size of the message when invoking msgsnd(2). Reported by: Coverity CID: 1368712 Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=316179
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
index 598882131a7d..b1d95e3cbca6 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
@@ -234,7 +234,7 @@ ATF_TC_BODY(msgsnd_nonblock, tc)
for (;;) {
errno = 0;
- rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+ rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
if (rv == -1 && errno == EAGAIN)
_exit(EXIT_SUCCESS);