From: Nicholas Nethercote Date: Mon, 18 Jul 2005 14:10:12 +0000 (+0000) Subject: add comment X-Git-Tag: svn/VALGRIND_3_0_0~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=776cd36bb4e5add333363dd1f4fe6b19c147bd44;p=thirdparty%2Fvalgrind.git add comment git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4163 --- diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 42beaed30e..ec51a40f1c 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -2322,6 +2322,8 @@ PRE(sys_execve) // child doesn't get vg_preload_core.so, vg_preload_TOOL.so, etc. // This is done unconditionally, since if we are tracing the child, // stage1/2 will set up the appropriate client environment. + // Nb: we make a copy of the environment before trying to mangle it + // as it might be in read-only memory (this was bug #101881). envp = VG_(env_clone)( (Char**)ARG3 ); if (envp != NULL) { VG_(env_remove_valgrind_env_stuff)( envp );