diff options
author | Longstreth Jon <Jon.Longstreth@mts.com> | 2014-02-06 10:58:17 +0100 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2014-02-06 10:58:17 +0100 |
commit | 190a0b89395f397b40aea02de6f362290ad6cc3d (patch) | |
tree | 6c707440b7f31cf768e315217c4efa8c2ebc2987 /parser.c | |
parent | b0c7e7e57ff9759446bc6c99b94a59a59f6b81a6 (diff) | |
download | android_external_libxml2-190a0b89395f397b40aea02de6f362290ad6cc3d.tar.gz android_external_libxml2-190a0b89395f397b40aea02de6f362290ad6cc3d.tar.bz2 android_external_libxml2-190a0b89395f397b40aea02de6f362290ad6cc3d.zip |
Fix a portability issue on Windows
Apparently an verflow when comparing macro and unsigned long
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2039,8 +2039,11 @@ static void xmlSHRINK (xmlParserCtxtPtr ctxt) { xmlGROW (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)) && + unsigned long curEnd = ctxt->input->end - ctxt->input->cur; + unsigned long curBase = ctxt->input->cur - ctxt->input->base; + + if (((curEnd > (unsigned long) XML_MAX_LOOKUP_LIMIT) || + (curBase > (unsigned long) XML_MAX_LOOKUP_LIMIT)) && ((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup"); |