Mercurial > hg > xemacs-beta
diff src/unexcw.c @ 1198:c1e69bcf8d07
[xemacs-hg @ 2003-01-10 14:12:40 by youngs]
2003-01-08 Andy Piper <andy@xemacs.org>
* unexcw.c (copy_executable_and_dump_data_section): Set the stack
reserve size during unexec().
author | youngs |
---|---|
date | Fri, 10 Jan 2003 14:12:41 +0000 |
parents | 184461bc8de4 |
children | 29c45c1b64f3 |
line wrap: on
line diff
--- a/src/unexcw.c Thu Jan 09 22:53:02 2003 +0000 +++ b/src/unexcw.c Fri Jan 10 14:12:41 2003 +0000 @@ -47,6 +47,7 @@ #include <a.out.h> #endif +#define STACK_SIZE 0x800000 #define ALLOC_UNIT 0xFFFF #define ALLOC_MASK ~((unsigned long) (ALLOC_UNIT)) #define ALIGN_ALLOC(addr) \ @@ -302,6 +303,9 @@ printf ("warning: new data size is < approx\n"); 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"); /* write text as is */