Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba72320

Browse files
committed
silence an overflow warning. slen is smaller than 1MB
1 parent d6dc952 commit ba72320

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/pyexpat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ xmlparse_Parse(xmlparseobject *self, PyObject *args)
835835
s += MAX_CHUNK_SIZE;
836836
slen -= MAX_CHUNK_SIZE;
837837
}
838-
rc = XML_Parse(self->itself, s, slen, isFinal);
838+
assert(MAX_CHUNK_SIZE < INT_MAX && slen < INT_MAX);
839+
rc = XML_Parse(self->itself, s, (int)slen, isFinal);
839840

840841
done:
841842
if (view.buf != NULL)

0 commit comments

Comments
 (0)