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 {
|
else {
|
||||||
end = lhs + (PyUnicode_GET_SIZE(u) - size);
|
end = lhs + (PyUnicode_GET_SIZE(u) - size);
|
||||||
while (lhs <= end) {
|
while (lhs <= end) {
|
||||||
if (memcmp(lhs++, rhs, size) == 0) {
|
if (memcmp(lhs++, rhs, size * sizeof(Py_UNICODE)) == 0) {
|
||||||
result = 1;
|
result = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue