From d08977f149a01afe8a88f413a6e52f4c9f699013 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 8 Aug 2023 12:06:50 +0800 Subject: [PATCH] Fix CVE-2023-38559 --- ghostscript-CVE-2023-38559.patch | 27 +++++++++++++++++++++++++++ ghostscript.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 ghostscript-CVE-2023-38559.patch diff --git a/ghostscript-CVE-2023-38559.patch b/ghostscript-CVE-2023-38559.patch new file mode 100644 index 0000000..e0a7bdd --- /dev/null +++ b/ghostscript-CVE-2023-38559.patch @@ -0,0 +1,27 @@ +From d81b82c70bc1fb9991bb95f1201abb5dea55f57f Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: Mon, 17 Jul 2023 14:06:37 +0100 +Subject: [PATCH] Bug 706897: Copy pcx buffer overrun fix from + devices/gdevpcx.c + +Bounds check the buffer, before dereferencing the pointer. +--- + base/gdevdevn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/base/gdevdevn.c b/base/gdevdevn.c +index 7b14d9c71..6351fb77a 100644 +--- a/base/gdevdevn.c ++++ b/base/gdevdevn.c +@@ -1983,7 +1983,7 @@ devn_pcx_write_rle(const byte * from, const byte * end, int step, gp_file * file + byte data = *from; + + from += step; +- if (data != *from || from == end) { ++ if (from >= end || data != *from) { + if (data >= 0xc0) + gp_fputc(0xc1, file); + } else { +-- +2.34.1 + diff --git a/ghostscript.spec b/ghostscript.spec index 1b8d2c0..11a7ce0 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %global _hardened_build 1 %global _docdir_fmt %{name} @@ -32,6 +32,7 @@ Provides: ghostscript-core = %{version}-%{release} Obsoletes: ghostscript-core < 9.53.3-6 Patch0: ghostscript-10.01.0-fix-linkage.patch +Patch1: ghostscript-CVE-2023-38559.patch %description Ghostscript is an interpreter for PostScript® and Portable Document Format (PDF) files. @@ -220,6 +221,9 @@ install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ %changelog +* Tue Aug 8 2023 Funda Wang - 10.01.2-2 +- Fix CVE-2023-38559 + * Fri Jun 30 2023 Funda Wang - 10.01.2-1 - New version 10.01.2 -- Gitee