svn commit: r224986 - head/sys/kern
John Baldwin
jhb at FreeBSD.org
Thu Aug 18 22:20:46 UTC 2011
Author: jhb
Date: Thu Aug 18 22:20:45 2011
New Revision: 224986
URL: http://svn.freebsd.org/changeset/base/224986
Log:
One of the general principles of the sysctl(3) API is that a user can
query the needed size for a sysctl result by passing in a NULL old
pointer and a valid oldsize. The kern.proc.args sysctl handler broke
this assumption by not calling SYSCTL_OUT() if the old pointer was
NULL.
Approved by: re (kib)
MFC after: 3 days
Modified:
head/sys/kern/kern_proc.c
Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c Thu Aug 18 18:15:59 2011 (r224985)
+++ head/sys/kern/kern_proc.c Thu Aug 18 22:20:45 2011 (r224986)
@@ -1391,7 +1391,7 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG
pa = p->p_args;
pargs_hold(pa);
PROC_UNLOCK(p);
- if (req->oldptr != NULL && pa != NULL)
+ if (pa != NULL)
error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length);
pargs_drop(pa);
if (error != 0 || req->newptr == NULL)
More information about the svn-src-head
mailing list