Initialize len to avoid ENOMEM from sysctl(3).

PR:		248933
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Li-Wen Hsu 2020-09-04 19:24:27 +00:00
parent b6c3b1a92d
commit 8e6b8fc655

View File

@ -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);