summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch')
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch b/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch
new file mode 100644
index 0000000000..91b9f6df50
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch
@@ -0,0 +1,31 @@
1From d81b82c70bc1fb9991bb95f1201abb5dea55f57f Mon Sep 17 00:00:00 2001
2From: Chris Liddell <chris.liddell@artifex.com>
3Date: Mon, 17 Jul 2023 14:06:37 +0100
4Subject: [PATCH] Bug 706897: Copy pcx buffer overrun fix from
5 devices/gdevpcx.c
6
7Bounds check the buffer, before dereferencing the pointer.
8
9Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d81b82c70bc1fb9991bb95f1201abb5dea55f57f]
10CVE: CVE-2023-38559
11Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
12---
13 base/gdevdevn.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/base/gdevdevn.c b/base/gdevdevn.c
17index 3b019d6..2888776 100644
18--- a/base/gdevdevn.c
19+++ b/base/gdevdevn.c
20@@ -1980,7 +1980,7 @@ devn_pcx_write_rle(const byte * from, const byte * end, int step, gp_file * file
21 byte data = *from;
22
23 from += step;
24- if (data != *from || from == end) {
25+ if (from >= end || data != *from) {
26 if (data >= 0xc0)
27 gp_fputc(0xc1, file);
28 } else {
29--
302.25.1
31