revert parser Fix progress check

(cherry picked from commit 5192523da8f39f67bd190f41c729cc067fce48eb)
This commit is contained in:
zhuofeng 2023-06-19 20:26:11 +08:00 committed by openeuler-sync-bot
parent d325924f5c
commit ca9978d3a1
2 changed files with 8 additions and 45 deletions

View File

@ -1,43 +0,0 @@
From 11f49efda51bfde64d341d7a475d480adfeeac79 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Mon, 21 Nov 2022 21:35:01 +0100
Subject: [PATCH 22/28] parser: Fix progress check when parsing character data
Skip over zero bytes to guarantee progress. Short-lived regression.
Reference: https://github.com/GNOME/libxml2/commit/a8b31e68c2331a1289e860ce07c8b80b855b7bf4
Conflict: parser.c:<xmlParseCharDataComplex>
---
parser.c | 2 +-
parserInternals.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/parser.c b/parser.c
index 4615db0..6e55838 100644
--- a/parser.c
+++ b/parser.c
@@ -4654,7 +4654,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) {
}
}
}
- if ((cur != 0) && (!IS_CHAR(cur))) {
+ if ((ctxt->input->cur < ctxt->input->end) && (!IS_CHAR(cur))) {
/* Generate the error and skip the offending character */
xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
"PCDATA invalid Char value %d\n",
diff --git a/parserInternals.c b/parserInternals.c
index 422dfc0..b8eab4b 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -406,7 +406,7 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
return;
}
- if ((*ctxt->input->cur == 0) &&
+ if ((ctxt->input->cur >= ctxt->input->end) &&
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) {
return;
}
--
2.27.0

View File

@ -1,7 +1,7 @@
Summary: Library providing XML and HTML support
Name: libxml2
Version: 2.9.14
Release: 6
Release: 7
License: MIT
Group: Development/Libraries
Source: https://download.gnome.org/sources/%{name}/2.9/%{name}-%{version}.tar.xz
@ -61,7 +61,7 @@ Patch6042: backport-uri-Allow-port-without-host.patch
Patch6043: backport-parser-Fix-consumed-accounting-when-switching-encodi.patch
Patch6044: backport-html-Fix-check-for-end-of-comment-in-push-parser.patch
Patch6045: backport-parser-Fix-push-parser-with-1-3-byte-initial-chunk.patch
Patch6046: backport-parser-Fix-progress-check-when-parsing-character-dat.patch
Patch6047: backport-parser-Restore-parser-state-in-xmlParseCDSect.patch
Patch6048: backport-parser-Remove-dangerous-check-in-xmlParseCharData.patch
Patch6049: backport-parser-Don-t-call-DefaultSAXHandlerInit-from-xmlInit.patch
@ -342,6 +342,12 @@ rm -fr %{buildroot}
%changelog
* Mon Jun 19 2023 zhuofeng <zhuofeng2@huawei.com> - 2.9.14-7
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:revert parser-Fix-progress-check
* Thu Jun 08 2023 zhuofeng <zhuofeng2@huawei.com> - 2.9.14-6
- Type:bugfix
- CVE:NA