mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-19 16:40:46 -09:00
package/jasper: add patch for CVE-2023-51257
This fixes the following vulnerability: - CVE-2023-51257: An invalid memory write issue in Jasper-Software Jasper v.4.1.1 and before allows a local attacker to execute arbitrary code. For more information see: - https://nvd.nist.gov//vuln/detail/CVE-2023-51257 -aeef5293c9Signed-off-by: Thomas Perale <thomas.perale@mind.be> Signed-off-by: Julien Olivain <ju.o@free.fr> (cherry picked from commit860c35d1ac) Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle
parent
42db5653f7
commit
eb6a93ab86
46
package/jasper/0001-Fixes-367.patch
Normal file
46
package/jasper/0001-Fixes-367.patch
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
From aeef5293c978158255ad4f127089644745602f2a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Adams <mdadams@ece.uvic.ca>
|
||||||
|
Date: Thu, 14 Dec 2023 19:04:19 -0800
|
||||||
|
Subject: [PATCH] Fixes #367.
|
||||||
|
|
||||||
|
Fixed an integer-overflow bug in the ICC profile parsing code.
|
||||||
|
Added another invalid image to the test set.
|
||||||
|
|
||||||
|
CVE: CVE-2023-51257
|
||||||
|
Upstream: https://github.com/jasper-software/jasper/commit/aeef5293c978158255ad4f127089644745602f2a
|
||||||
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||||
|
---
|
||||||
|
src/libjasper/base/jas_icc.c | 16 ++++++++++++++--
|
||||||
|
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/libjasper/base/jas_icc.c b/src/libjasper/base/jas_icc.c
|
||||||
|
index 905b823..2d1e91e 100644
|
||||||
|
--- a/src/libjasper/base/jas_icc.c
|
||||||
|
+++ b/src/libjasper/base/jas_icc.c
|
||||||
|
@@ -1295,10 +1295,22 @@ static int jas_icctxt_input(jas_iccattrval_t *attrval, jas_stream_t *in,
|
||||||
|
{
|
||||||
|
jas_icctxt_t *txt = &attrval->data.txt;
|
||||||
|
txt->string = 0;
|
||||||
|
- if (!(txt->string = jas_malloc(cnt)))
|
||||||
|
+ /* The string must at least contain a single null character. */
|
||||||
|
+ if (cnt < 1) {
|
||||||
|
goto error;
|
||||||
|
- if (jas_stream_read(in, txt->string, cnt) != cnt)
|
||||||
|
+ }
|
||||||
|
+ if (!(txt->string = jas_malloc(cnt))) {
|
||||||
|
+ goto error;
|
||||||
|
+ }
|
||||||
|
+ if (jas_stream_read(in, txt->string, cnt) != cnt) {
|
||||||
|
goto error;
|
||||||
|
+ }
|
||||||
|
+ /* Ensure that the string is null terminated. */
|
||||||
|
+ if (txt->string[cnt - 1] != '\0') {
|
||||||
|
+ goto error;
|
||||||
|
+ }
|
||||||
|
+ /* The following line is redundant, unless we do not enforce that
|
||||||
|
+ the last character must be null. */
|
||||||
|
txt->string[cnt - 1] = '\0';
|
||||||
|
if (strlen(txt->string) + 1 != cnt)
|
||||||
|
goto error;
|
||||||
|
--
|
||||||
|
2.39.5
|
||||||
@@ -15,6 +15,9 @@ JASPER_CONF_OPTS = \
|
|||||||
-DJAS_ENABLE_DOC=OFF \
|
-DJAS_ENABLE_DOC=OFF \
|
||||||
-DJAS_ENABLE_PROGRAMS=OFF
|
-DJAS_ENABLE_PROGRAMS=OFF
|
||||||
|
|
||||||
|
# 0001-Fixes-367.patch
|
||||||
|
JASPER_IGNORE_CVES += CVE-2023-51257
|
||||||
|
|
||||||
ifeq ($(BR2_STATIC_LIBS),y)
|
ifeq ($(BR2_STATIC_LIBS),y)
|
||||||
JASPER_CONF_OPTS += -DJAS_ENABLE_SHARED=OFF
|
JASPER_CONF_OPTS += -DJAS_ENABLE_SHARED=OFF
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user