mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-24214: Fixed the UTF-8 incremental decoder. (GH-12603)
The bug occurred when the encoded surrogate character is passed to the incremental decoder in two chunks.
This commit is contained in:
parent
38f4e468d4
commit
7a465cb5ee
3 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue