mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Fix core dump in an endcase of b.strip() that I missed.
This commit is contained in:
parent
2fb5ac745b
commit
eb29e9ab2b
2 changed files with 5 additions and 1 deletions
|
@ -2502,7 +2502,10 @@ bytes_strip(PyBytesObject *self, PyObject *arg)
|
|||
argptr = ((PyBytesObject *)arg)->ob_bytes;
|
||||
argsize = Py_Size(arg);
|
||||
left = lstrip_helper(myptr, mysize, argptr, argsize);
|
||||
right = rstrip_helper(myptr, mysize, argptr, argsize);
|
||||
if (left == mysize)
|
||||
right = left;
|
||||
else
|
||||
right = rstrip_helper(myptr, mysize, argptr, argsize);
|
||||
return PyBytes_FromStringAndSize(self->ob_bytes + left, right - left);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue