mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
26260: fix crash failing to assigns scalar to special hash
This commit is contained in:
parent
bb883ca78f
commit
d69bd194b9
2 changed files with 17 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-01-08 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 26260: Src/params.c: fix crash when failing to assign
|
||||
scalar to special hash.
|
||||
|
||||
2009-01-06 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* unposted: Doc/Zsh/mod_stat.yo: fix yodl problem with 26229.
|
||||
|
|
15
Src/params.c
15
Src/params.c
|
@ -495,10 +495,10 @@ scancountparams(UNUSED(HashNode hn), int flags)
|
|||
static Patprog scanprog;
|
||||
static char *scanstr;
|
||||
static char **paramvals;
|
||||
static Param foundparam;
|
||||
static Param foundparam;
|
||||
|
||||
/**/
|
||||
void
|
||||
static void
|
||||
scanparamvals(HashNode hn, int flags)
|
||||
{
|
||||
struct value v;
|
||||
|
@ -538,6 +538,7 @@ scanparamvals(HashNode hn, int flags)
|
|||
--numparamvals; /* Value didn't match, discard key */
|
||||
} else
|
||||
++numparamvals;
|
||||
foundparam = NULL;
|
||||
}
|
||||
|
||||
/**/
|
||||
|
@ -2270,7 +2271,15 @@ setstrvalue(Value v, char *val)
|
|||
break;
|
||||
case PM_HASHED:
|
||||
{
|
||||
foundparam->gsu.s->setfn(foundparam, val);
|
||||
if (foundparam == NULL)
|
||||
{
|
||||
zerr("%s: attempt to set associative array to scalar",
|
||||
v->pm->node.nam);
|
||||
zsfree(val);
|
||||
return;
|
||||
}
|
||||
else
|
||||
foundparam->gsu.s->setfn(foundparam, val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue