mirror of
https://github.com/python/cpython
synced 2024-10-09 08:19:53 +00:00
PyUnicode_Contains(): The memcmp() call didn't take into account the
width of Py_UNICODE. Good catch, MAL.
This commit is contained in:
parent
496e6581e1
commit
6a043f3fe8
|
@ -3765,7 +3765,7 @@ int PyUnicode_Contains(PyObject *container,
|
|||
else {
|
||||
end = lhs + (PyUnicode_GET_SIZE(u) - size);
|
||||
while (lhs <= end) {
|
||||
if (memcmp(lhs++, rhs, size) == 0) {
|
||||
if (memcmp(lhs++, rhs, size * sizeof(Py_UNICODE)) == 0) {
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue