gh-157710: Detect overflow in PyUnicodeWriter_Finish() #157715

Merged
vstinner opened 5:40pm on September 17, 2026 wanted to merge 91 Ξ” into python/cpython main from
unicode_overflow
Diff Delta:
91
About 55 Diff Delta/hour
Classified as:  General

vstinner's Description of Work

Check if the trailing null character has been modified to detect buffer overflow in C extensions.

_PyUnicode_CheckConsistency() now always check if the trailing null character has been overridden to detect buffer overflow. Previously, it was only been checked if check_content parameter was non-zero.


  • Issue: gh-157710
    <!-- /gh-issue-number -->

5 total changed files
(1 file ignored)
Loading changes...
Loading changes...
Loading changes...
That’s the last hunk
Like the credits, but with fewer stunts.