summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-07-16 21:30:54 +0000
committerbluhm <bluhm@openbsd.org>2019-07-16 21:30:54 +0000
commit9b633c7ea17b4a44ba6f5c4b007f2c1cf9395e4d (patch)
tree84a9f9033ed0280cf588a3de94ff09b4fb1bd175
parentNew realpath(3) requires existing files. Create fake disk images (diff)
downloadwireguard-openbsd-9b633c7ea17b4a44ba6f5c4b007f2c1cf9395e4d.tar.xz
wireguard-openbsd-9b633c7ea17b4a44ba6f5c4b007f2c1cf9395e4d.zip
According to POSIX msgsnd(2) has to fail with EINVAL if passing a
message with mtype < 1. from Moritz Buhl; OK kn@
-rw-r--r--sys/kern/sysv_msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index 7f745a91356..54b28a5965d 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_msg.c,v 1.34 2018/12/05 15:42:45 mpi Exp $ */
+/* $OpenBSD: sysv_msg.c,v 1.35 2019/07/16 21:30:54 bluhm Exp $ */
/* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */
/*
* Copyright (c) 2009 Bret S. Lambert <blambert@openbsd.org>
@@ -588,7 +588,7 @@ msg_copyin(struct msg *msg, const char *ubuf, size_t len, struct proc *p)
return (error);
}
- if (msg->msg_type < 0) {
+ if (msg->msg_type < 1) {
msg_free(msg);
return (EINVAL);
}