Date: Thu, 18 Aug 2011 22:20:45 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r224986 - head/sys/kern Message-ID: <201108182220.p7IMKjoB075715@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108182220.p7IMKjoB075715>