From: Serhiy Storchaka Date: Wed, 16 Nov 2016 14:12:34 +0000 (+0200) Subject: Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). X-Git-Tag: v3.6.0b4~68^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=292dd1b2ad51285e793f23af4157251780c9a638;p=thirdparty%2FPython%2Fcpython.git Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 15705e10f9d9..6212cc4c822d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -10846,7 +10846,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;