From cf9f0487e43349063e92854409297bf3068fd88a Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 14 Jun 2014 22:00:29 +0000 Subject: Rather than truncating KERN_ARND requests silently, return EINVAL ok miod --- sys/kern/kern_sysctl.c | 4 ++-- 1 file 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))) -- cgit v1.2.3