Bug 1222867
Summary: | zsh in ksh emulation mode, coredumps when trying to check the syntax of a shell script | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Tim Speetjens <tspeetje> | |
Component: | zsh | Assignee: | Kamil Dudka <kdudka> | |
Status: | CLOSED ERRATA | QA Contact: | Jan Kepler <jkejda> | |
Severity: | urgent | Docs Contact: | ||
Priority: | urgent | |||
Version: | 7.0 | CC: | fkrska, isenfeld, mkolaja, msvistun, ovasik | |
Target Milestone: | rc | Keywords: | Patch, ZStream | |
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | zsh-5.0.2-11.el7 | Doc Type: | Bug Fix | |
Doc Text: |
Previously, the code that initializes environment variables in zsh did not correctly handle NULL values. As a consequence, zsh terminated unexpectedly when attempting to check the syntax of a shell script in ksh emulation mode. This update fixes the handling of NULL values, and the syntax check now works as expected when zsh runs in ksh emulation mode.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1274697 (view as bug list) | Environment: | ||
Last Closed: | 2015-11-19 05:20:32 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1274697 |
Description
Tim Speetjens
2015-05-19 10:28:43 UTC
Thank you for reporting the bug! The following patch fixes the problem for me: --- a/Src/params.c +++ b/Src/params.c @@ -4574,22 +4574,24 @@ addenv(Param pm, char *value) /* Given strings *name = "foo", *value = "bar", * * return a new string *str = "foo=bar". */ /**/ static char * 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; *s && (*s++ != Meta || *s++ != 32); len_value++); s = str = (char *) zalloc(len_name + len_value + 2); strcpy(s, name); s += len_name; *s = '='; copyenvstr(s, value, flags); return str; } I will check with upstream whether it is a correct way to fix it. upstream commit: http://sourceforge.net/p/zsh/code/ci/af957f2e fixed in zsh-5.0.7-8.fc2{0,1,2,3} *** Bug 1267251 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2208.html |