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

See issue #5389.
This commit is contained in:
Guido van Rossum 2009-03-05 21:47:33 +00:00
parent 2a67a84954
commit c261e4868b
1 changed files with 3 additions and 2 deletions

View File

@ -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,
} }
} }
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;