[Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Fix out of bounds read in long_new() for empty bytes with an explicit base.
Terry Reedy
tjreedy at udel.edu
Wed Sep 12 18:14:32 CEST 2012
On 9/12/2012 10:22 AM, Stefan Krah wrote:
> christian.heimes <python-checkins at python.org> wrote:
>> Fix out of bounds read in long_new() for empty bytes with an explicit base.
>> int(b'', somebase) calls PyLong_FromString() with char* of length 1
I don't know what happens internally, but such calls raise
ValueError: invalid literal for int() with base 16: ''
Of course, even if int() traps such calls before calling
PyLong_FromString, an extension writer could goof.
Does the length 1 come from added \0?
By the way, excessively long lines in checkin messages are a nuisance
from reading and responding ;-).
--
Terry Jan Reedy
More information about the Python-Dev
mailing list