!110 [sync] PR-105: fix CVE-2024-45491, CVE-2024-45492
From: @openeuler-sync-bot Reviewed-by: @dillon_chen Signed-off-by: @dillon_chen
This commit is contained in:
commit
bd976649cb
31
backport-CVE-2024-45491.patch
Normal file
31
backport-CVE-2024-45491.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From 8e439a9947e9dc80a395c0c7456545d8d9d9e421 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sebastian Pipping <sebastian@pipping.org>
|
||||||
|
Date: Mon, 19 Aug 2024 22:34:13 +0200
|
||||||
|
Subject: [PATCH] lib: Detect integer overflow in dtdCopy
|
||||||
|
|
||||||
|
Reported by TaiYou
|
||||||
|
---
|
||||||
|
expat/lib/xmlparse.c | 10 ++++++++++
|
||||||
|
1 file changed, 10 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||||
|
index 91682c188..e2327bdcf 100644
|
||||||
|
--- a/lib/xmlparse.c
|
||||||
|
+++ b/lib/xmlparse.c
|
||||||
|
@@ -7016,6 +7016,16 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd,
|
||||||
|
if (! newE)
|
||||||
|
return 0;
|
||||||
|
if (oldE->nDefaultAtts) {
|
||||||
|
+ /* Detect and prevent integer overflow.
|
||||||
|
+ * The preprocessor guard addresses the "always false" warning
|
||||||
|
+ * from -Wtype-limits on platforms where
|
||||||
|
+ * sizeof(int) < sizeof(size_t), e.g. on x86_64. */
|
||||||
|
+#if UINT_MAX >= SIZE_MAX
|
||||||
|
+ if ((size_t)oldE->nDefaultAtts
|
||||||
|
+ > ((size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE))) {
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
newE->defaultAtts = (DEFAULT_ATTRIBUTE *)ms->malloc_fcn(
|
||||||
|
oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
|
||||||
|
if (! newE->defaultAtts) {
|
||||||
30
backport-CVE-2024-45492.patch
Normal file
30
backport-CVE-2024-45492.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From 9bf0f2c16ee86f644dd1432507edff94c08dc232 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sebastian Pipping <sebastian@pipping.org>
|
||||||
|
Date: Mon, 19 Aug 2024 22:37:16 +0200
|
||||||
|
Subject: [PATCH] lib: Detect integer overflow in function nextScaffoldPart
|
||||||
|
|
||||||
|
Reported by TaiYou
|
||||||
|
---
|
||||||
|
expat/lib/xmlparse.c | 9 +++++++++
|
||||||
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||||
|
index 91682c188..f737575ea 100644
|
||||||
|
--- a/lib/xmlparse.c
|
||||||
|
+++ b/lib/xmlparse.c
|
||||||
|
@@ -7558,6 +7558,15 @@ nextScaffoldPart(XML_Parser parser) {
|
||||||
|
int next;
|
||||||
|
|
||||||
|
if (! dtd->scaffIndex) {
|
||||||
|
+ /* Detect and prevent integer overflow.
|
||||||
|
+ * The preprocessor guard addresses the "always false" warning
|
||||||
|
+ * from -Wtype-limits on platforms where
|
||||||
|
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||||
|
+#if UINT_MAX >= SIZE_MAX
|
||||||
|
+ if (parser->m_groupSize > ((size_t)(-1) / sizeof(int))) {
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int));
|
||||||
|
if (! dtd->scaffIndex)
|
||||||
|
return -1;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
%define Rversion %(echo %{version} | sed -e 's/\\./_/g' -e 's/^/R_/')
|
%define Rversion %(echo %{version} | sed -e 's/\\./_/g' -e 's/^/R_/')
|
||||||
Name: expat
|
Name: expat
|
||||||
Version: 2.4.1
|
Version: 2.4.1
|
||||||
Release: 12
|
Release: 13
|
||||||
Summary: An XML parser library
|
Summary: An XML parser library
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://libexpat.github.io/
|
URL: https://libexpat.github.io/
|
||||||
@ -50,6 +50,8 @@ Patch39: backport-009-CVE-2023-52425.patch
|
|||||||
Patch40: backport-001-CVE-2024-45490.patch
|
Patch40: backport-001-CVE-2024-45490.patch
|
||||||
Patch41: backport-002-CVE-2024-45490.patch
|
Patch41: backport-002-CVE-2024-45490.patch
|
||||||
Patch42: backport-003-CVE-2024-45490.patch
|
Patch42: backport-003-CVE-2024-45490.patch
|
||||||
|
Patch43: backport-CVE-2024-45491.patch
|
||||||
|
Patch44: backport-CVE-2024-45492.patch
|
||||||
|
|
||||||
BuildRequires: sed,autoconf,automake,gcc-c++,libtool,xmlto
|
BuildRequires: sed,autoconf,automake,gcc-c++,libtool,xmlto
|
||||||
|
|
||||||
@ -103,6 +105,9 @@ make check
|
|||||||
%{_mandir}/man1/*
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Sep 04 2024 Funda Wang <fundawang@yeah.net> - 2.4.1-13
|
||||||
|
- fix CVE-2024-45491, CVE-2024-45492
|
||||||
|
|
||||||
* Tue Sep 3 2024 caixiaomeng <caixiaomeng2@huawei.com> - 2.4.1-12
|
* Tue Sep 3 2024 caixiaomeng <caixiaomeng2@huawei.com> - 2.4.1-12
|
||||||
- fix CVE-2024-45490
|
- fix CVE-2024-45490
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user