[issue13496] bisect module: Overflow at index computation

Daniel Sturm report at bugs.python.org
Tue Nov 29 01:25:37 CET 2011


Daniel Sturm <voodoon42 at gmail.com> added the comment:

TBH I saw this more as an opportunity to get used to the whole system, how to create a patch, etc. :) Should've made it clearer at the start that this is unlikely to ever be a problem, sorry (didn't see a way to set priority to low myself).


If my math isn't completely off, the highest possible value here is 
hi + (hi - 1) so this only occurs if hi > (MAX_SSIZE_T + 1) / 2. So this would only work out if we had such an array containing only a handful different objects. And then that's me assuming that a list is actually a thin wrapper around an array of PyObject*.

----------

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


More information about the Python-bugs-list mailing list