diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-25 11:15:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 11:15:14 (GMT) |
commit | b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c (patch) | |
tree | fdced2a6b57abb0be7f710d4c70320deec48ce57 /Objects | |
parent | 058741cc39dd2b63907931e2b626f7428ba13253 (diff) | |
download | cpython-b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c.zip cpython-b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c.tar.gz cpython-b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c.tar.bz2 |
[3.11] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613) (GH-107224)
Previously *consumed was not set in this case.
(cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 50deefe..ffa8b98 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5120,6 +5120,9 @@ unicode_decode_utf8(const char *s, Py_ssize_t size, } s += ascii_decode(s, end, PyUnicode_1BYTE_DATA(u)); if (s == end) { + if (consumed) { + *consumed = size; + } return u; } |