mirror of
https://github.com/python/cpython.git
synced 2025-11-27 13:45:25 +00:00
bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603)
This commit is contained in:
parent
c38e725d17
commit
24ddd9c2d6
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue