diff options
author | Guido van Rossum <guido@python.org> | 2009-03-05 21:47:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2009-03-05 21:47:33 (GMT) |
commit | c261e4868b9bb5d85cd8c8955ef301c51f2a8155 (patch) | |
tree | 1031748664ef2ff5ef7f402d515a337f197cd906 /Objects/unicodeobject.c | |
parent | 2a67a849546a5b312da6838a575b7ec8e45115e5 (diff) | |
download | cpython-c261e4868b9bb5d85cd8c8955ef301c51f2a8155.zip cpython-c261e4868b9bb5d85cd8c8955ef301c51f2a8155.tar.gz cpython-c261e4868b9bb5d85cd8c8955ef301c51f2a8155.tar.bz2 |
Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7().
See issue #5389.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files 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; |