mirror of
https://github.com/python/cpython.git
synced 2025-08-05 09:28:41 +00:00
[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 f08e52ccb0
)
This commit is contained in:
parent
058741cc39
commit
b8b3e6afc0
4 changed files with 95 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue