]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
setup_client_stack: use have_exename to consistently guard uses
authorJulian Seward <jseward@acm.org>
Wed, 4 May 2011 09:07:38 +0000 (09:07 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 4 May 2011 09:07:38 +0000 (09:07 +0000)
of VG_(args_the_exename), thereby avoiding a potential segfault.
Spotted by IBM's BEAM checker.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11724

coregrind/m_initimg/initimg-linux.c

index 4b9f0dd7a016c586e1b3d29bb80121e6dd2964af..3250343b506968420762f4a07876dc7c30a796bc 100644 (file)
@@ -456,7 +456,7 @@ Addr setup_client_stack( void*  init_sp,
         stringsize += VG_(strlen)(cauxv->u.a_ptr) + 1;
       else if (cauxv->a_type == AT_RANDOM)
         stringsize += 16;
-      else if (cauxv->a_type == AT_EXECFN)
+      else if (cauxv->a_type == AT_EXECFN && have_exename)
         stringsize += VG_(strlen)(VG_(args_the_exename)) + 1;
       auxsize += sizeof(*cauxv);
    }