summaryrefslogtreecommitdiff
path: root/dev-libs/libxml2/files/libxml2-2.11.2-0004-huge-push.patch
blob: 5f3d060382714e52d841395d020079044c5e57fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
https://gitlab.gnome.org/GNOME/libxml2/-/commit/7c14859d0779797a93ea75744266425028599944

From 7c14859d0779797a93ea75744266425028599944 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Tue, 9 May 2023 13:28:06 +0200
Subject: [PATCH] parser: Fix "huge input lookup" error with push parser

Fix parsing of larger documents without XML_PARSE_HUGE.

Should fix #538.
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -418,9 +418,10 @@ xmlParserShrink(xmlParserCtxtPtr ctxt) {
     xmlParserInputBufferPtr buf = in->buf;
     size_t used;
 
-    /* Don't shrink memory buffers. */
+    /* Don't shrink pull parser memory buffers. */
     if ((buf == NULL) ||
-        ((buf->encoder == NULL) && (buf->readcallback == NULL)))
+        ((ctxt->progressive == 0) &&
+         (buf->encoder == NULL) && (buf->readcallback == NULL)))
         return;
 
     used = in->cur - in->base;
-- 
GitLab