Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: select: Fix leak of 256 bytes on every loop when zle is not used
- X-seq: zsh-workers 34180
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: select: Fix leak of 256 bytes on every loop when zle is not used
- Date: Fri, 9 Jan 2015 14:10:16 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=jfp2YLvEkjrlvPyOyErPqzAV0MXdhveFkEJ7U1cbUyY=; b=bwq993Xvk7V/eCE/L16/sH62hSNhX6IkC71Hk5KDiSaTbww+51gyiPJgLApUyAfx1t pIObouDYWa42ndwfk2iyTkzYLdIjH6rdKIsSHA+uYS1j6v/DchpU3tN4E41Ra3146mt/ cWG9ozw2HxLhrdXz6nHg4Yekc6Hcstvtz7NeeIYnWFcNnQGRGbRvKyUEpJxlvHM3Qpg9 nzFxkrDGUhwiICf6soA7lZySCS/PN/VUrpIW0e6wbSZuTCa2ZdLgttPSoamQAlvI+2bx RCqWQpQvslQn2H9ZflCPXTitXw6WLRsojySOS1F4FXllfJgbdB0s7IgG1OHAymBCQy0L wcUg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Reproduce by
yes | head -n 1000000 | zsh -c 'select foo in a b c; do done; sleep 30; echo'
Found by Coverity (Issue 439082).
---
Src/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/loop.c b/Src/loop.c
index 7b3bdd2..d025fbb 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -269,7 +269,7 @@ execselect(Estate state, UNUSED(int do_exec))
zputs(str, stderr);
free(str);
fflush(stderr);
- str = fgets(zalloc(256), 256, inp);
+ str = fgets(zhalloc(256), 256, inp);
}
} else
str = (char *)getlinknode(bufstack);
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author