You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Heap buffer overflow in _PyTokenizer_ensure_utf8 #144872
The root cause is that valid_utf8() in Parser/tokenizer/helpers.c checks continuation bytes in reverse order thus reader s[expected] before s[1] on these lines:
When a multi-byte UTF-8 sequence is truncated - such as a 3-byte lead \xEA followed immediately by a null terminator - the backward loop reads past the end of the valid data before encountering the null byte that would stop it.
Activity
pythongh-144872: move NEWS entry to Core_and_Builtins
gh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (#144807)
pythongh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (p…
[3.14] gh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (…
pythongh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (p…
[3.13] pythongh-144872: fix heap buffer overflow `_PyTokenizer_ensure…
[3.13] gh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (…
pablogsal commentedon Mar 2, 2026
Thanks a lot for the report @AdamKorcz !
pythongh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (p…