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) {
|
||||
/* startswith */
|
||||
if (start + slen > len)
|
||||
if (start > len - slen)
|
||||
goto notfound;
|
||||
} else {
|
||||
/* endswith */
|
||||
|
Loading…
x
Reference in New Issue
Block a user