diff options
author | Xtreak <tirkarthi@users.noreply.github.com> | 2018-07-26 21:50:34 +0530 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-26 19:20:34 +0300 |
commit | 2bea7716093012319b5e6a4260fe802b15031f21 (patch) | |
tree | dabb99b7e01742747c20f9ed5bdcf1a8aaed3ab5 /Objects/sliceobject.c | |
parent | 1c8f6553ad5a7f97495972da8f35f4dabcb372d4 (diff) | |
download | cpython-git-2bea7716093012319b5e6a4260fe802b15031f21.tar.gz |
bpo-34229: Check start and stop of slice object to be long when they are not int in PySlice_GetIndices (GH-8480)
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r-- | Objects/sliceobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index c66e057cdb..9daeafcc4a 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -113,14 +113,14 @@ PySlice_GetIndices(PySliceObject *r, Py_ssize_t length, if (r->start == Py_None) { *start = *step < 0 ? length-1 : 0; } else { - if (!PyInt_Check(r->start) && !PyLong_Check(r->step)) return -1; + if (!PyInt_Check(r->start) && !PyLong_Check(r->start)) return -1; *start = PyInt_AsSsize_t(r->start); if (*start < 0) *start += length; } if (r->stop == Py_None) { *stop = *step < 0 ? -1 : length; } else { - if (!PyInt_Check(r->stop) && !PyLong_Check(r->step)) return -1; + if (!PyInt_Check(r->stop) && !PyLong_Check(r->stop)) return -1; *stop = PyInt_AsSsize_t(r->stop); if (*stop < 0) *stop += length; } |