diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-01-29 17:11:39 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-01-29 17:11:39 (GMT) |
commit | 36ecd676eac6c9d7ace41a1ff35124912371e91d (patch) | |
tree | 4b0feee8c71c1921b339e69a57f72dce9a1ba857 /Modules | |
parent | b5d7400e8a62ebedb8575cca8cd777e29c230e91 (diff) | |
download | cpython-36ecd676eac6c9d7ace41a1ff35124912371e91d.zip cpython-36ecd676eac6c9d7ace41a1ff35124912371e91d.tar.gz cpython-36ecd676eac6c9d7ace41a1ff35124912371e91d.tar.bz2 |
Issue #7788: Fix a crash produced by deleting a list slice with huge
step value. Patch by Marcin Bachry.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/arraymodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 018ab87..c631b61 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1792,8 +1792,9 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value) } else if (needed == 0) { /* Delete slice */ - Py_ssize_t cur, i; - + size_t cur; + Py_ssize_t i; + if (step < 0) { stop = start + 1; start = stop + step * (slicelength - 1) - 1; |