summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 04fd6d0..0460d18 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4479,6 +4479,11 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
if (_PyUnicodeWriter_WriteCharInline(&writer, '+') < 0)
goto onError;
}
+ else if (s < e && !IS_BASE64(*s)) {
+ s++;
+ errmsg = "ill-formed sequence";
+ goto utf7Error;
+ }
else { /* begin base64-encoded section */
inShift = 1;
surrogate = 0;