summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 14:13:13 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 14:13:13 (GMT)
commite6d6131f78fdb08fa8270b7b689571d8058208e3 (patch)
treefb78542d8271ed3a3f322e5381648278d3748092
parent503db266a5fa4043b57f558645f4bfe18ffec5b6 (diff)
parentdf66b9c425f90cc4a5dc910daf4ca3dedcc265c9 (diff)
downloadcpython-e6d6131f78fdb08fa8270b7b689571d8058208e3.zip
cpython-e6d6131f78fdb08fa8270b7b689571d8058208e3.tar.gz
cpython-e6d6131f78fdb08fa8270b7b689571d8058208e3.tar.bz2
Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 4b28ce4..25b3b1d 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -11051,7 +11051,7 @@ non_ready_unicode_equal_to_ascii_string(PyObject *unicode, const char *str)
assert(p);
for (i = 0; i < len; i++) {
unsigned char c = (unsigned char)str[i];
- if (c > 128 || p[i] != (wchar_t)c)
+ if (c >= 128 || p[i] != (wchar_t)c)
return 0;
}
return 1;