Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] mkenvstr: avoid crash in case NULL is given as value
- X-seq: zsh-workers 35223
- From: Kamil Dudka <kdudka@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] mkenvstr: avoid crash in case NULL is given as value
- Date: Tue, 19 May 2015 20:24:14 +0200
- 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
The crash happens while running a syntax check in ksh emulation mode:
ln -s /bin/zsh ksh
echo > script.sh
./ksh -n script.sh
Originally reported at <https://bugzilla.redhat.com/1222867>.
---
Src/params.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Src/params.c b/Src/params.c
index 045ac1e..1df97c6 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -4582,6 +4582,8 @@ mkenvstr(char *name, char *value, int flags)
{
char *str, *s;
int len_name, len_value;
+ if (!value)
+ return NULL;
len_name = strlen(name);
for (len_value = 0, s = value;
--
2.4.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author