cups: Fix CVE-2023-4504

(From OE-Core rev: dc5c06da7a793e85276ce8ce9de1c06decb6e133)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Lee Chee Yang
2023-09-27 19:47:01 +08:00
committed by Steve Sakoman
parent 6cbbd132d3
commit 425ed15bde
2 changed files with 43 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ SRC_URI = "https://github.com/OpenPrinting/cups/releases/download/v${PV}/cups-${
file://CVE-2023-32324.patch \
file://CVE-2023-34241.patch \
file://CVE-2023-32360.patch \
file://CVE-2023-4504.patch \
"
UPSTREAM_CHECK_URI = "https://github.com/OpenPrinting/cups/releases"

View File

@@ -0,0 +1,42 @@
CVE: CVE-2023-4504
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/2431caddb7e6a87f04ac90b5c6366ad268b6ff31 ]
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
From 2431caddb7e6a87f04ac90b5c6366ad268b6ff31 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Wed, 20 Sep 2023 14:45:17 +0200
Subject: [PATCH] raster-interpret.c: Fix CVE-2023-4504
We didn't check for end of buffer if it looks there is an escaped
character - check for NULL terminator there and if found, return NULL
as return value and in `ptr`, because a lone backslash is not
a valid PostScript character.
---
cups/raster-interpret.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/cups/raster-interpret.c b/cups/raster-interpret.c
index 6fcf731b5..b8655c8c6 100644
--- a/cups/raster-interpret.c
+++ b/cups/raster-interpret.c
@@ -1116,7 +1116,19 @@ scan_ps(_cups_ps_stack_t *st, /* I - Stack */
cur ++;
- if (*cur == 'b')
+ /*
+ * Return NULL if we reached NULL terminator, a lone backslash
+ * is not a valid character in PostScript.
+ */
+
+ if (!*cur)
+ {
+ *ptr = NULL;
+
+ return (NULL);
+ }
+
+ if (*cur == 'b')
*valptr++ = '\b';
else if (*cur == 'f')
*valptr++ = '\f';