From d4e71152bd70ed6531fa416c2cb7a63d7fa160d7 Mon Sep 17 00:00:00 2001 From: trociny Date: Sun, 15 Jan 2012 18:47:24 +0000 Subject: Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want to read strings completely to know the actual size. As a side effect it fixes the issue with kern.proc.args and kern.proc.env sysctls, which didn't return the size of available data when calling sysctl(3) with the NULL argument for oldp. Note, in get_ps_strings(), which does actual work for proc_getargv() and proc_getenvv(), we still have a safety limit on the size of data read in case of a corrupted procces stack. Suggested by: kib MFC after: 3 days --- sys/fs/procfs/procfs_status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/fs/procfs') diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c index d981e5e..a97e0a9 100644 --- a/sys/fs/procfs/procfs_status.c +++ b/sys/fs/procfs/procfs_status.c @@ -193,5 +193,5 @@ procfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); - return (proc_getargv(td, p, sb, ARG_MAX)); + return (proc_getargv(td, p, sb)); } -- cgit v1.1