From: Guido van Rossum Date: Thu, 5 Mar 2009 21:47:33 +0000 (+0000) Subject: Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7(). X-Git-Tag: v2.5.5c1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c261e4868b9bb5d85cd8c8955ef301c51f2a8155;p=python Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7(). See issue #5389. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4c308ccfe0..af6f67a18b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1012,7 +1012,7 @@ PyObject *PyUnicode_DecodeUTF7(const char *s, } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1036,9 +1036,10 @@ PyObject *PyUnicode_DecodeUTF7(const char *s, } } else if (SPECIAL(ch,0,0)) { + startinpos = s-starts; errmsg = "unexpected special character"; s++; - goto utf7Error; + goto utf7Error; } else { *p++ = ch;