[issue11697] Unsigned type in mmap_move_method

Rafael Zanella report at bugs.python.org
Sun Apr 24 15:35:21 CEST 2011


Rafael Zanella <rafael.zanella at yahoo.com.br> added the comment:

Seems like it should use size_t since it deals with memory location/obj size, but Python doesn't have size_t only ssize_t, and ssize_t is signed...

"m.move(2**32, 10, 4)   # Should throw a ValueError" <- Won't it wrap around and become 0 once truncated ?

I've attached a patch that I believe fixes the bounds check, though it's still wrong on the types, since it's not portable.

----------
keywords: +patch
nosy: +zanella
Added file: http://bugs.python.org/file21763/mmap.move.patch

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


More information about the Python-bugs-list mailing list