[issue24708] strop.replace Integer Overflow

Serhiy Storchaka report at bugs.python.org
Sat Jul 25 08:12:45 CEST 2015


Serhiy Storchaka added the comment:

Here is modified patch. In new code we try to avoid integer wrap around. It is safer to raise MemoryError right after PyMem_MALLOC(), otherwise it would possible to reraise unrelated exception instead MemoryError if strop.replace() is called without clearing current exception (should never happen, but...). Error message made consistent with str.replace().

----------
Added file: http://bugs.python.org/file40010/strop.replace_Integer_Overflow_2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24708>
_______________________________________


More information about the Python-bugs-list mailing list