Subject: CVS commit: src/sys/kern
To: None <source-changes@NetBSD.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: source-changes
Date: 09/10/2006 05:46:03
Module Name:	src
Committed By:	manu
Date:		Sun Sep 10 05:46:03 UTC 2006

Modified Files:
	src/sys/kern: init_sysctl.c

Log Message:
When getting the program argument or environement string, we previously
assumed that all the strings were stored in a row, separated by NUL chars,
 at the address pointed bu argv[0] (or envp[0]).

This was wrong: if the program changed argvs[0], we still read the
first string correctly, but the next strings did contain unexpected data.

The fix: read the whole argv (or envp) array, then copy the string one by
one, using their addresses in argv (or agrp)


To generate a diff of this commit:
cvs rdiff -r1.83 -r1.84 src/sys/kern/init_sysctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.