bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603)
This commit is contained in:
parent
c38e725d17
commit
24ddd9c2d6
@ -743,7 +743,7 @@ tailmatch(const char *str, Py_ssize_t len, PyObject *substr,
|
|||||||
|
|
||||||
if (direction < 0) {
|
if (direction < 0) {
|
||||||
/* startswith */
|
/* startswith */
|
||||||
if (start + slen > len)
|
if (start > len - slen)
|
||||||
goto notfound;
|
goto notfound;
|
||||||
} else {
|
} else {
|
||||||
/* endswith */
|
/* endswith */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user