Skip to content

Commit 5046358

Browse files
committed
add assertion per Victor's suggestion
1 parent 2ac9464 commit 5046358

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/codecs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc)
851851
*outp++ = '&';
852852
*outp++ = '#';
853853
while (digits-- > 0) {
854+
assert(base >= 1);
854855
*outp++ = '0' + ch / base;
855856
ch %= base;
856857
base /= 10;

0 commit comments

Comments
 (0)