diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-05-09 13:28:06 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-05-09 13:30:21 +0200 |
commit | 9dae389cee166ff4061828be74720a632811d9a8 (patch) | |
tree | 7cedf0e9eaad25090392db881a2c0f99c87dcbb7 | |
parent | b8961df65d077457863780892f2d39ac4c04c0af (diff) | |
download | libxml2-9dae389cee166ff4061828be74720a632811d9a8.tar.gz |
parser: Fix "huge input lookup" error with push parser
Fix parsing of larger documents without XML_PARSE_HUGE.
Should fix #538.
-rw-r--r-- | parserInternals.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/parserInternals.c b/parserInternals.c index 6612ea74..ddc874ca 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -639,9 +639,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; |