Message322394
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "cpython/Objects/sliceobject.c" line 116 function PySlice_GetIndices.
if (r->start == Py_None) {
*start = *step < 0 ? length-1 : 0;
} else {
if (!PyInt_Check(r->start) && !PyLong_Check(r->step)) return -1;//HERE
*start = PyInt_AsSsize_t(r->start);
if (*start < 0) *start += length;
}
Shouldn't start field of r be used in the second check (instead of step)?
In a related potential issue, in line 123, shouldn't r->stop be checked in the second verification?
Thanks,
Petru Florin Mihancea |
|
Date |
User |
Action |
Args |
2018-07-26 04:55:28 | petrum@gmail.com | set | recipients:
+ petrum@gmail.com |
2018-07-26 04:55:28 | petrum@gmail.com | set | messageid: <1532580928.78.0.56676864532.issue34229@psf.upfronthosting.co.za> |
2018-07-26 04:55:28 | petrum@gmail.com | link | issue34229 messages |
2018-07-26 04:55:28 | petrum@gmail.com | create | |
|