Kaydet (Commit) c261e486 authored tarafından Guido van Rossum's avatar Guido van Rossum

Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7().

See issue #5389.
üst 2a67a849
...@@ -1012,7 +1012,7 @@ PyObject *PyUnicode_DecodeUTF7(const char *s, ...@@ -1012,7 +1012,7 @@ PyObject *PyUnicode_DecodeUTF7(const char *s,
} }
} else if (SPECIAL(ch,0,0)) { } else if (SPECIAL(ch,0,0)) {
errmsg = "unexpected special character"; errmsg = "unexpected special character";
goto utf7Error; goto utf7Error;
} else { } else {
*p++ = ch; *p++ = ch;
} }
...@@ -1036,9 +1036,10 @@ PyObject *PyUnicode_DecodeUTF7(const char *s, ...@@ -1036,9 +1036,10 @@ PyObject *PyUnicode_DecodeUTF7(const char *s,
} }
} }
else if (SPECIAL(ch,0,0)) { else if (SPECIAL(ch,0,0)) {
startinpos = s-starts;
errmsg = "unexpected special character"; errmsg = "unexpected special character";
s++; s++;
goto utf7Error; goto utf7Error;
} }
else { else {
*p++ = ch; *p++ = ch;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment