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

PATCH: Constant initial fdtable_size



This is intended for the 4-0-patches branch; it should fix the crash reported
in 16082.  Presumably it's sufficiently noncontroversial to commit?

Index: Src/init.c
===================================================================
--- Src/init.c	2001/09/24 15:40:12	1.6
+++ Src/init.c	2001/10/22 14:41:42
@@ -1190,7 +1190,8 @@
 	  break;
     } while (zsh_name);
 
-    fdtable_size = zopenmax();
+    /* Not zopenmax() here: it may return a number too big for zcalloc(). */
+    fdtable_size = 256; /* This grows as necessary, see utils.c:movefd(). */
     fdtable = zcalloc(fdtable_size);
 
     createoptiontable();

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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