summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 8ab3943..c0b345b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4883,6 +4883,9 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
case 2:
case 3:
case 4:
+ if (s == end || consumed) {
+ goto End;
+ }
errmsg = "invalid continuation byte";
startinpos = s - starts;
endinpos = startinpos + ch - 1;