[issue7788] segfault when deleting from a list using slice with very big `step' value

Mark Dickinson report at bugs.python.org
Tue Jan 26 21:04:19 CET 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks.  Yes, that fix seems to work.  I also tried rewriting the suspect test as

if (step >= Py_SIZE(self) - cur)

but this produced a different failure:  it looks like there's more than one point with potential overflow for cur.  Not to mention that the 'cur += step' in the for loop can produce undefined behaviour.

So making cur unsigned looks like the right solution here.

It would be good to review the rest of this function for similar problems while we're fixing this.

----------

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


More information about the Python-bugs-list mailing list