From: Barry Warsaw Date: Tue, 6 Aug 2002 19:03:17 +0000 (+0000) Subject: PyUnicode_Contains(): The memcmp() call didn't take into account the X-Git-Tag: v2.3c1~4662 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a043f3fe8394fe8f8178df313ccf7af69ba50b9;p=thirdparty%2FPython%2Fcpython.git PyUnicode_Contains(): The memcmp() call didn't take into account the width of Py_UNICODE. Good catch, MAL. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a577bfd4d77f..03b5dbd9704d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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; }