mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)
Previously *consumed was not set in this case.
This commit is contained in:
parent
d460c8ec52
commit
f08e52ccb0
4 changed files with 95 additions and 0 deletions
|
@ -4530,6 +4530,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