mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-12 01:11:27 +02:00
Avoid crash copying empty hash table.
Visible with typeset -p.
This commit is contained in:
parent
1e46f73b8e
commit
c2cc8b0fbe
2 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
||||||
2018-01-04 Peter Stephenson <p.stephenson@samsung.com>
|
2018-01-04 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* Stephane: 42159: Src/params.c: avoid crash copying empty hash table.
|
||||||
|
|
||||||
* Sebastian: 42188: Src/Modules/system.c: It is necessary to
|
* Sebastian: 42188: Src/Modules/system.c: It is necessary to
|
||||||
close the lock descriptor in some failure cases.
|
close the lock descriptor in some failure cases.
|
||||||
|
|
||||||
|
|
11
Src/params.c
11
Src/params.c
|
@ -549,10 +549,13 @@ scancopyparams(HashNode hn, UNUSED(int flags))
|
||||||
HashTable
|
HashTable
|
||||||
copyparamtable(HashTable ht, char *name)
|
copyparamtable(HashTable ht, char *name)
|
||||||
{
|
{
|
||||||
HashTable nht = newparamtable(ht->hsize, name);
|
HashTable nht = 0;
|
||||||
outtable = nht;
|
if (ht) {
|
||||||
scanhashtable(ht, 0, 0, 0, scancopyparams, 0);
|
nht = newparamtable(ht->hsize, name);
|
||||||
outtable = NULL;
|
outtable = nht;
|
||||||
|
scanhashtable(ht, 0, 0, 0, scancopyparams, 0);
|
||||||
|
outtable = NULL;
|
||||||
|
}
|
||||||
return nht;
|
return nht;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue