From: Julian Seward Date: Sat, 5 May 2007 11:40:35 +0000 (+0000) Subject: Fix stack overflow which lead to totally mysterious .bss corruption X-Git-Tag: svn/VALGRIND_3_3_0~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=696fb88c46dd583faadb21c826ec7a70b3351f4a;p=thirdparty%2Fvalgrind.git Fix stack overflow which lead to totally mysterious .bss corruption 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 --- diff --git a/coregrind/m_ume.c b/coregrind/m_ume.c index efb9a2cc80..92d4012425 100644 --- a/coregrind/m_ume.c +++ b/coregrind/m_ume.c @@ -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);