From c261e4868b9bb5d85cd8c8955ef301c51f2a8155 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 5 Mar 2009 21:47:33 +0000 Subject: Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7(). See issue #5389. --- Objects/unicodeobject.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4c308cc..af6f67a 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; -- cgit v0.12