gnu: Add libpfm4.
[jackhill/guix/guix.git] / gnu / packages / patches / zsh-CVE-2018-7549.patch
1 Fix CVE-2018-7549:
2
3 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7549
4
5 Patch copied from upstream source repository:
6
7 https://sourceforge.net/p/zsh/code/ci/c2cc8b0fbefc9868fa83537f5b6d90fc1ec438dd
8
9 From c2cc8b0fbefc9868fa83537f5b6d90fc1ec438dd Mon Sep 17 00:00:00 2001
10 From: Stephane Chazelas <stephane.chazelas@gmail.com>
11 Date: Fri, 22 Dec 2017 22:17:09 +0000
12 Subject: [PATCH] Avoid crash copying empty hash table.
13
14 Visible with typeset -p.
15 ---
16 ChangeLog | 2 ++
17 Src/params.c | 11 +++++++----
18 2 files changed, 9 insertions(+), 4 deletions(-)
19
20 #diff --git a/ChangeLog b/ChangeLog
21 #index f74c26b88..e3628cfa7 100644
22 #--- a/ChangeLog
23 #+++ b/ChangeLog
24 #@@ -1,5 +1,7 @@
25 # 2018-01-04 Peter Stephenson <p.stephenson@samsung.com>
26 #
27 #+ * Stephane: 42159: Src/params.c: avoid crash copying empty hash table.
28 #+
29 # * Sebastian: 42188: Src/Modules/system.c: It is necessary to
30 # close the lock descriptor in some failure cases.
31 #
32 diff --git a/Src/params.c b/Src/params.c
33 index 31ff0445b..de7730ae7 100644
34 --- a/Src/params.c
35 +++ b/Src/params.c
36 @@ -549,10 +549,13 @@ scancopyparams(HashNode hn, UNUSED(int flags))
37 HashTable
38 copyparamtable(HashTable ht, char *name)
39 {
40 - HashTable nht = newparamtable(ht->hsize, name);
41 - outtable = nht;
42 - scanhashtable(ht, 0, 0, 0, scancopyparams, 0);
43 - outtable = NULL;
44 + HashTable nht = 0;
45 + if (ht) {
46 + nht = newparamtable(ht->hsize, name);
47 + outtable = nht;
48 + scanhashtable(ht, 0, 0, 0, scancopyparams, 0);
49 + outtable = NULL;
50 + }
51 return nht;
52 }
53
54 --
55 2.16.2
56