summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-08-06 19:03:17 (GMT)
committerBarry Warsaw <barry@python.org>2002-08-06 19:03:17 (GMT)
commit6a043f3fe8394fe8f8178df313ccf7af69ba50b9 (patch)
tree104cf461e8436351d333ddb12abed6e2bec7d910 /Objects
parent496e6581e1f4fab85014b17c3db95e0378c4ffc0 (diff)
downloadcpython-6a043f3fe8394fe8f8178df313ccf7af69ba50b9.zip
cpython-6a043f3fe8394fe8f8178df313ccf7af69ba50b9.tar.gz
cpython-6a043f3fe8394fe8f8178df313ccf7af69ba50b9.tar.bz2
PyUnicode_Contains(): The memcmp() call didn't take into account the
width of Py_UNICODE. Good catch, MAL.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a577bfd..03b5dbd 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;
}