diff options
author | Daniel Veillard <veillard@redhat.com> | 2012-10-26 13:50:47 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-10-26 13:50:47 +0800 |
commit | 153cf15905cf4ec080612ada6703757d10caba1e (patch) | |
tree | da38d77f2b5a563fcae61b533fcfc17d21c594e7 | |
parent | 711b15d545713b3a34a51ce8163d1162533647c9 (diff) | |
download | android_external_libxml2-153cf15905cf4ec080612ada6703757d10caba1e.tar.gz android_external_libxml2-153cf15905cf4ec080612ada6703757d10caba1e.tar.bz2 android_external_libxml2-153cf15905cf4ec080612ada6703757d10caba1e.zip |
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.
-rw-r--r-- | libxml.h | 2 | ||||
-rw-r--r-- | parser.c | 1 | ||||
-rw-r--r-- | xmlIO.c | 2 |
3 files changed, 4 insertions, 1 deletions
@@ -91,6 +91,8 @@ void __xmlGlobalInitMutexDestroy(void); int __xmlRandom(void); #endif +int xmlNop(void); + #ifdef IN_LIBXML #ifdef __GNUC__ #ifdef PIC @@ -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; @@ -800,7 +800,7 @@ xmlCheckFilename (const char *path) return 1; } -static int +int xmlNop(void) { return(0); } |