#2242: utf7 decoding crashes on bogus input on some Windows/MSVC versions

This commit is contained in:
Antoine Pitrou 2008-07-25 19:00:48 +00:00
parent ab396e07cc
commit c8e4bed1c5
3 changed files with 20 additions and 14 deletions

View file

@ -974,7 +974,7 @@ PyObject *PyUnicode_DecodeUTF7(const char *s,
while (s < e) {
Py_UNICODE ch;
restart:
ch = *s;
ch = (unsigned char) *s;
if (inShift) {
if ((ch == '-') || !B64CHAR(ch)) {