mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
Fix large parse of file from memory
https://bugzilla.redhat.com/show_bug.cgi?id=862969 The new code trying to detect excessive input lookup would just get wrong sometimes in the case of very large file parsed directly from memory.
This commit is contained in:
2
libxml.h
2
libxml.h
@@ -91,6 +91,8 @@ void __xmlGlobalInitMutexDestroy(void);
|
||||
int __xmlRandom(void);
|
||||
#endif
|
||||
|
||||
int xmlNop(void);
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
#ifdef __GNUC__
|
||||
#ifdef PIC
|
||||
|
1
parser.c
1
parser.c
@@ -2025,6 +2025,7 @@ static void xmlSHRINK (xmlParserCtxtPtr ctxt) {
|
||||
static void xmlGROW (xmlParserCtxtPtr ctxt) {
|
||||
if ((((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) ||
|
||||
((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) &&
|
||||
((ctxt->input->buf) && (ctxt->input->buf->readcallback != xmlNop)) &&
|
||||
((ctxt->options & XML_PARSE_HUGE) == 0)) {
|
||||
xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup");
|
||||
ctxt->instate = XML_PARSER_EOF;
|
||||
|
Reference in New Issue
Block a user