Issue #1621: Fix undefined behaviour from signed overflow in datetime module hashes, array and list iterations, and get_integer (stringlib/string_format.h)

This commit is contained in:
Mark Dickinson 2011-09-25 15:34:32 +01:00
parent 50203a69b3
commit c7d93b7614
4 changed files with 14 additions and 16 deletions

View file

@ -2351,7 +2351,7 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
self->ob_item + (cur + 1) * itemsize,
lim * itemsize);
}
cur = start + slicelength * step;
cur = start + (size_t)slicelength * step;
if (cur < (size_t)Py_SIZE(self)) {
memmove(self->ob_item + (cur-slicelength) * itemsize,
self->ob_item + cur * itemsize,