diff options
| author | Bart Schaefer <barts@users.sourceforge.net> | 2001-10-22 15:14:41 +0000 |
|---|---|---|
| committer | Bart Schaefer <barts@users.sourceforge.net> | 2001-10-22 15:14:41 +0000 |
| commit | 4b76c491c942f655e7cf013fa63febbd751a1c08 (patch) | |
| tree | 12cacf4825142856466566b688de28b22cd4166a | |
| parent | Fix segfault in checkrmall(). (diff) | |
| download | zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar.gz zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar.bz2 zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar.lz zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar.xz zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.tar.zst zsh-4b76c491c942f655e7cf013fa63febbd751a1c08.zip | |
Fix fdtable_size crash.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Src/init.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2001-10-22 Bart Schaefer <schaefer@zsh.org> + + * 16109: Use a fixed initial fdtable_size to fix crash resulting + from a huge memory allocation, as reported in 16082. + 2001-10-20 Bart Schaefer <schaefer@zsh.org> * Adapted from Stefan Dalibor, 16043: Src/utils.c: checkrmall() diff --git a/Src/init.c b/Src/init.c index f343f3025..ffe873e4f 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1190,7 +1190,8 @@ zsh_main(int argc, char **argv) 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(); |
