X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexcw.c;h=81a38b19868222aad82fc00396e6e96b991a8e1d;hb=4722bc54af41d050cb2bf24670d152f3fb0547b7;hp=1b8ad088a985f2b58d6ddf77d84866f42f646c94;hpb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4;p=chise%2Fxemacs-chise.git.1 diff --git a/src/unexcw.c b/src/unexcw.c index 1b8ad08..81a38b1 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -54,6 +54,7 @@ unexec (char *, char *, void *, void *, void *) #include #endif +#define STACK_SIZE 0x800000 #define ALLOC_UNIT 0xFFFF #define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT)) #define ALIGN_ALLOC(addr) \ @@ -340,6 +341,9 @@ copy_executable_and_dump_data_section (int a_out, int a_new) } f_ohdr.dsize=new_data_size; f_ohdr.bsize=BSS_PAD_SIZE; + /* Prevent stack overflow with regexp usage. */ + f_ohdr.SizeOfStackReserve = STACK_SIZE; + if (write(a_new, &f_ohdr, sizeof(f_ohdr)) != sizeof(f_ohdr)) { PERROR("failed to write optional header");