zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] mkenvstr: avoid crash in case NULL is given as value
@ 2015-05-19 18:24 Kamil Dudka
  2015-05-19 23:12 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Kamil Dudka @ 2015-05-19 18:24 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-20 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 18:24 [PATCH] mkenvstr: avoid crash in case NULL is given as value Kamil Dudka
2015-05-19 23:12 ` Bart Schaefer
2015-05-20 14:43   ` Kamil Dudka
2015-05-20 17:23     ` Bart Schaefer
2015-05-20 17:35       ` Kamil Dudka
2015-05-20 18:17         ` Kamil Dudka

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).