summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-12-08 21:11:19 +0100
committerMarius Bakke <marius@gnu.org>2020-12-08 22:57:53 +0100
commit3bd218e8d4abde56e7ce9149311df5e60db0e321 (patch)
tree156d70367f257d68b2066d8840d34600dea330f3 /gnu/packages
parent9337c16cb69fd47ca31ebe184d2a37028b978249 (diff)
gnu: ghostscript: Fix CVE-2020-15900.
* gnu/packages/patches/ghostscript-CVE-2020-15900.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/ghostscript.scm (ghostscript)[source](patches): Add it.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/ghostscript.scm1
-rw-r--r--gnu/packages/patches/ghostscript-CVE-2020-15900.patch36
2 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index b132fba7eb7..03a516dc522 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -171,6 +171,7 @@ printing, and psresize, for adjusting page sizes.")
171 (base32 171 (base32
172 "0z1w42y2jmcpl2m1l3z0sfii6zmvzcwcgzn6bydklia6ig7jli2p")) 172 "0z1w42y2jmcpl2m1l3z0sfii6zmvzcwcgzn6bydklia6ig7jli2p"))
173 (patches (search-patches "ghostscript-freetype-compat.patch" 173 (patches (search-patches "ghostscript-freetype-compat.patch"
174 "ghostscript-CVE-2020-15900.patch"
174 "ghostscript-no-header-creationdate.patch" 175 "ghostscript-no-header-creationdate.patch"
175 "ghostscript-no-header-id.patch" 176 "ghostscript-no-header-id.patch"
176 "ghostscript-no-header-uuid.patch")) 177 "ghostscript-no-header-uuid.patch"))
diff --git a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
new file mode 100644
index 00000000000..b6658d7c7f6
--- /dev/null
+++ b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
@@ -0,0 +1,36 @@
1Fix CVE-2020-15900.
2
3https://cve.circl.lu/cve/CVE-2020-15900
4https://artifex.com/security-advisories/CVE-2020-15900
5
6Taken from upstream:
7https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b
8
9diff --git a/psi/zstring.c b/psi/zstring.c
10--- a/psi/zstring.c
11+++ b/psi/zstring.c
12@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward)
13 return 0;
14 found:
15 op->tas.type_attrs = op1->tas.type_attrs;
16- op->value.bytes = ptr;
17- r_set_size(op, size);
18+ op->value.bytes = ptr; /* match */
19+ op->tas.rsize = size; /* match */
20 push(2);
21- op[-1] = *op1;
22- r_set_size(op - 1, ptr - op[-1].value.bytes);
23- op1->value.bytes = ptr + size;
24- r_set_size(op1, count + (!forward ? (size - 1) : 0));
25+ op[-1] = *op1; /* pre */
26+ op[-3].value.bytes = ptr + size; /* post */
27+ if (forward) {
28+ op[-1].tas.rsize = ptr - op[-1].value.bytes; /* pre */
29+ op[-3].tas.rsize = count; /* post */
30+ } else {
31+ op[-1].tas.rsize = count; /* pre */
32+ op[-3].tas.rsize -= count + size; /* post */
33+ }
34 make_true(op);
35 return 0;
36 }