fix CVE-2024-34459

This commit is contained in:
cenhuilin 2024-05-17 09:38:28 +08:00
parent 15e5370826
commit 88ba0783c6
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 2876ac5392a4e891b81e40e592c3ac6cb46016ce Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 17 May 2024 08:50:50 +0800
Subject: [PATCH] [CVE-2024-34459] Fix buffer overread with `xmllint --htmlout`
Add a missing bounds check.
---
xmllint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xmllint.c b/xmllint.c
index 398670b..3f4bfb2 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -559,7 +559,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) {
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, "\n");
cur = input->cur;
- while ((*cur == '\n') || (*cur == '\r'))
+ while ((cur > base) && ((*cur == '\n') || (*cur == '\r')))
cur--;
n = 0;
while ((cur != base) && (n++ < 80)) {
--
2.33.0

View File

@ -1,7 +1,7 @@
Summary: Library providing XML and HTML support Summary: Library providing XML and HTML support
Name: libxml2 Name: libxml2
Version: 2.11.5 Version: 2.11.5
Release: 2 Release: 3
License: MIT License: MIT
Group: Development/Libraries Group: Development/Libraries
Source: https://download.gnome.org/sources/%{name}/2.11/%{name}-%{version}.tar.xz Source: https://download.gnome.org/sources/%{name}/2.11/%{name}-%{version}.tar.xz
@ -11,6 +11,7 @@ Patch1: backport-CVE-2023-45322.patch
Patch2: backport-xpath-Remove-remaining-references-to-valueFrame.patch Patch2: backport-xpath-Remove-remaining-references-to-valueFrame.patch
Patch3: backport-examples-Don-t-call-xmlCleanupParser-and-xmlMemoryDu.patch Patch3: backport-examples-Don-t-call-xmlCleanupParser-and-xmlMemoryDu.patch
Patch4: backport-CVE-2024-25062.patch Patch4: backport-CVE-2024-25062.patch
Patch5: backport-CVE-2024-34459.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: python3-devel BuildRequires: python3-devel
@ -162,6 +163,12 @@ rm -fr %{buildroot}
%changelog %changelog
* Fri May 17 2024 cenhuilin <cenhuilin@kylinos.cn> - 2.11.5-3
- Type:CVE
- CVE:CVE-2024-34459
- SUG:NA
- DESC:fix CVE-2024-34459
* Mon Feb 05 2024 Paul Thomas <paulthomas100199@gmail.com> - 2.11.5-2 * Mon Feb 05 2024 Paul Thomas <paulthomas100199@gmail.com> - 2.11.5-2
- Type:CVE - Type:CVE
- CVE:CVE-2024-25062 - CVE:CVE-2024-25062