]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix stack overflow which lead to totally mysterious .bss corruption
authorJulian Seward <jseward@acm.org>
Sat, 5 May 2007 11:40:35 +0000 (11:40 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 5 May 2007 11:40:35 +0000 (11:40 +0000)
and hence to segfaulting in vex on ppc32/64-linux in obscure
circumstances.  VKI_MAX_PAGE_SIZE is 64k in recent Valgrinds.

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

coregrind/m_ume.c

index efb9a2cc8002b2d7fcd36c670bcc7967f1899278..92d4012425b3cb0c7aa91fe9f2bdf1575f11378e 100644 (file)
@@ -565,8 +565,8 @@ static Int do_exec_inner(const HChar* exe, ExeInfo* info);
 /* returns: 0 = success, non-0 is failure */
 static Int load_script(Int fd, const HChar* name, ExeInfo* info)
 {
-   Char  hdr[VKI_MAX_PAGE_SIZE];
-   Int   len = VKI_PAGE_SIZE;
+   Char  hdr[4096];
+   Int   len = 4096;
    Int   eol;
    Char* interp;
    Char* end;
@@ -640,8 +640,8 @@ SysRes VG_(pre_exec_check)(const HChar* exe_name, Int* out_fd)
 {
    Int fd, ret;
    SysRes res;
-   Char  buf[VKI_MAX_PAGE_SIZE];
-   SizeT bufsz = VKI_PAGE_SIZE, fsz;
+   Char  buf[4096];
+   SizeT bufsz = 4096, fsz;
 
    // Check it's readable
    res = VG_(open)(exe_name, VKI_O_RDONLY, 0);