mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-08 00:06:04 +02:00
44509: Prevent crash with modified path / PATH combination.
Crash came from "fn() { typeset -U path=($path); unset PATH; }". Note PATH unset is global as only path was made local.
This commit is contained in:
parent
09385d38ad
commit
8cbbc04d97
|
@ -1,6 +1,11 @@
|
|||
2019-07-15 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 44509: Src/params.c: Prevent crash with modified PATH / path
|
||||
combination in function.
|
||||
|
||||
2019-07-10 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 44305: Functions/Chpwd/zsh_directory_name_generic: Longest
|
||||
* 44505: Functions/Chpwd/zsh_directory_name_generic: Longest
|
||||
prefix matching was broken if there were suffixes indicating
|
||||
further handling.
|
||||
|
||||
|
|
10
Src/params.c
10
Src/params.c
|
@ -3617,11 +3617,19 @@ unsetparam_pm(Param pm, int altflag, int exp)
|
|||
altpm = (Param) paramtab->getnode(paramtab, altremove);
|
||||
/* tied parameters are at the same local level as each other */
|
||||
oldpm = NULL;
|
||||
/*
|
||||
* Look for param under alternate name hidden by a local.
|
||||
* If this parameter is special, however, the visible
|
||||
* parameter is the special and the hidden one is keeping
|
||||
* an old value --- we just mark the visible one as unset.
|
||||
*/
|
||||
if (altpm && !(altpm->node.flags & PM_SPECIAL))
|
||||
{
|
||||
while (altpm && altpm->level > pm->level) {
|
||||
/* param under alternate name hidden by a local */
|
||||
oldpm = altpm;
|
||||
altpm = altpm->old;
|
||||
}
|
||||
}
|
||||
if (altpm) {
|
||||
if (oldpm && !altpm->level) {
|
||||
oldpm->old = NULL;
|
||||
|
|
Loading…
Reference in New Issue