[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    valgrind/coregrind
From:       Tom Hughes <thh () cyberscience ! com>
Date:       2005-07-18 23:24:02
Message-ID: 1121729042.827329.30523.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 436074 by thughes:

Fix crash when no environment is given to execve.


 M  +3 -4      vg_syscalls.c  


--- trunk/valgrind/coregrind/vg_syscalls.c #436073:436074
@@ -1697,7 +1697,7 @@
 PRE(sys_execve, Special)
 {
    Char *path;		/* path to executable */
-   Char **envp;         /* environment */
+   Char **envp = NULL;  /* environment */
 
    PRINT("sys_execve ( %p(%s), %p, %p )", arg1, arg1, arg2, arg3);
    PRE_REG_READ3(vki_off_t, "execve",
@@ -1751,9 +1751,8 @@
    // child doesn't get vg_inject.so, vgpreload.so, etc.  This is
    // done unconditionally, since if we are tracing the child,
    // stage1/2 will set up the appropriate client environment.
-   envp = VG_(env_clone)( (Char**)arg3 );
-
-   if (envp != NULL) {
+   if (arg3 != NULL) {
+      envp = VG_(env_clone)( (Char**)arg3 );
       VG_(env_remove_valgrind_env_stuff)( envp ); 
    }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic