setup_client_stack: use have_exename to consistently guard uses

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
This commit is contained in:
Julian Seward 2011-05-04 09:07:38 +00:00
parent 1ccdd881a6
commit 29c20eaeb0

View 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);
}