]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
silence an overflow warning. slen is smaller than 1MB
authorChristian Heimes <christian@cheimes.de>
Thu, 21 Nov 2013 23:46:18 +0000 (00:46 +0100)
committerChristian Heimes <christian@cheimes.de>
Thu, 21 Nov 2013 23:46:18 +0000 (00:46 +0100)
Modules/pyexpat.c

index e11c15355b8311239729ae89b016663e26e01c38..3f51c12cebce8ec36f41a230e0e11d165bb7d0f0 100644 (file)
@@ -835,7 +835,8 @@ xmlparse_Parse(xmlparseobject *self, PyObject *args)
         s += MAX_CHUNK_SIZE;
         slen -= MAX_CHUNK_SIZE;
     }
-    rc = XML_Parse(self->itself, s, slen, isFinal);
+    assert(MAX_CHUNK_SIZE < INT_MAX && slen < INT_MAX);
+    rc = XML_Parse(self->itself, s, (int)slen, isFinal);
 
 done:
     if (view.buf != NULL)