diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-14 22:00:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-14 22:00:29 +0000 |
commit | cf9f0487e43349063e92854409297bf3068fd88a (patch) | |
tree | 0ad13cbfdaf46bf349ae00a8b7c2142c5dcb1c43 | |
parent | ad091fcf72df72181857d235adb197558bdc4b42 (diff) |
Rather than truncating KERN_ARND requests silently, return EINVAL
ok miod
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 002886468c4..a6aa9a95d80 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.251 2014/06/14 21:59:38 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.252 2014/06/14 22:00:28 deraadt Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -413,7 +413,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, char buf[512]; if (*oldlenp > sizeof(buf)) - *oldlenp = sizeof(buf); + return (EINVAL); if (oldp) { arc4random_buf(buf, *oldlenp); if ((error = copyout(buf, oldp, *oldlenp))) |