aboutsummaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorLongstreth Jon <Jon.Longstreth@mts.com>2014-02-06 10:58:17 +0100
committerDaniel Veillard <veillard@redhat.com>2014-02-06 10:58:17 +0100
commit190a0b89395f397b40aea02de6f362290ad6cc3d (patch)
tree6c707440b7f31cf768e315217c4efa8c2ebc2987 /parser.c
parentb0c7e7e57ff9759446bc6c99b94a59a59f6b81a6 (diff)
downloadandroid_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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index d61c2161..0bf1aa2e 100644
--- a/parser.c
+++ b/parser.c
@@ -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");