Date: Fri, 4 Sep 2020 19:24:27 +0000 (UTC) From: Li-Wen Hsu <lwhsu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365337 - head/tests/sys/kern Message-ID: <202009041924.084JORGv038282@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lwhsu Date: Fri Sep 4 19:24:27 2020 New Revision: 365337 URL: https://svnweb.freebsd.org/changeset/base/365337 Log: Initialize len to avoid ENOMEM from sysctl(3). PR: 248933 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/kern_copyin.c Modified: head/tests/sys/kern/kern_copyin.c ============================================================================== --- head/tests/sys/kern/kern_copyin.c Fri Sep 4 18:55:03 2020 (r365336) +++ head/tests/sys/kern/kern_copyin.c Fri Sep 4 19:24:27 2020 (r365337) @@ -66,6 +66,7 @@ get_maxuser_address(void) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PS_STRINGS; mib[3] = getpid(); + len = sizeof(psstrings); error = sysctl(mib, nitems(mib), &psstrings, &len, NULL, 0); if (error != 0) return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009041924.084JORGv038282>