代码拉取完成,页面将自动刷新
From e2d37972e41224b11ff76f3a9fd689207b6108a6 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <[email protected]>
Date: Sun, 20 Nov 2022 15:35:49 +0100
Subject: [PATCH 21/28] parser: Fix push parser with 1-3 byte initial chunk
Make sure that ctxt->charset is initialized properly.
Reference: https://github.com/GNOME/libxml2/commit/55fb8f72ac726b4f760136070e0d2093ffcdb3ac
Conflict: NA
---
parser.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/parser.c b/parser.c
index 7553f86..4615db0 100644
--- a/parser.c
+++ b/parser.c
@@ -12523,9 +12523,10 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
* the encoding, we set the context to XML_CHAR_ENCODING_NONE so
* that it can be automatically determined later
*/
- if ((size == 0) || (chunk == NULL)) {
- ctxt->charset = XML_CHAR_ENCODING_NONE;
- } else if ((ctxt->input != NULL) && (ctxt->input->buf != NULL)) {
+ ctxt->charset = XML_CHAR_ENCODING_NONE;
+
+ if ((size != 0) && (chunk != NULL) &&
+ (ctxt->input != NULL) && (ctxt->input->buf != NULL)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
size_t cur = ctxt->input->cur - ctxt->input->base;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。