diff options
author | Guido van Rossum <guido@python.org> | 2000-06-28 21:12:25 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-06-28 21:12:25 (GMT) |
commit | 106f2dae868770f6b6ed2c949dd5b4deb07b880b (patch) | |
tree | c42f8b51a752763ed1ca2d35d9ac484039199ec6 /Doc | |
parent | 7388f730a3e28696867e490ff12d0ea3153fad57 (diff) | |
download | cpython-106f2dae868770f6b6ed2c949dd5b4deb07b880b.zip cpython-106f2dae868770f6b6ed2c949dd5b4deb07b880b.tar.gz cpython-106f2dae868770f6b6ed2c949dd5b4deb07b880b.tar.bz2 |
Trent Mick:
Various small fixes to the builtin module to ensure no buffer
overflows.
- chunk #1:
Proper casting to ensure no truncation, and hence no surprises, in the
comparison.
- chunk #2:
The id() function guarantees a unique return value for different
objects. It does this by returning the pointer to the object. By
returning a PyInt, on Win64 (sizeof(long) < sizeof(void*)) the pointer
is truncated and the guarantee may be proven false. The appropriate
return function is PyLong_FromVoidPtr, this returns a PyLong if that
is necessary to return the pointer without truncation.
[GvR: note that this means that id() can now return a long on Win32
platforms. This *might* break some code...]
- chunk #3:
Ensure no overflow in raw_input(). Granted the user would have to pass
in >2GB of data but it *is* a possible buffer overflow condition.
Diffstat (limited to 'Doc')
0 files changed, 0 insertions, 0 deletions