Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: Bug#251378: zsh: segfaults when globing includes too many files



This seems to fix it.  It was actually fairly obvious, since there was
only one case of reallocationg a heap where fheap wasn't set to NULL.
However, the script focussed my mind wonderfully.

Index: Src/mem.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mem.c,v
retrieving revision 1.11
diff -u -r1.11 mem.c
--- Src/mem.c	2 Jun 2004 22:14:26 -0000	1.11
+++ Src/mem.c	17 Jul 2004 19:18:10 -0000
@@ -491,6 +491,7 @@
 	     */
 	    size_t n = (new + sizeof(*h) + HEAPSIZE);
 	    n -= n % HEAPSIZE;
+	    fheap = NULL;
 
 #ifdef USE_MMAP
 	    {

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author