File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Release date: TBA
1111Core and Builtins
1212-----------------
1313
14+ - Issue #23321: Fixed a crash in str.decode() when error handler returned
15+ replacment string longer than mailformed input data.
16+
1417- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
1518
1619- Issue #20335: bytes constructor now raises TypeError when encoding or errors
Original file line number Diff line number Diff line change @@ -4190,9 +4190,13 @@ unicode_decode_call_errorhandler_writer(
41904190 if (PyUnicode_READY (repunicode ) < 0 )
41914191 goto onError ;
41924192 replen = PyUnicode_GET_LENGTH (repunicode );
4193- writer -> min_length += replen ;
4194- if ( replen > 1 )
4193+ if ( replen > 1 ) {
4194+ writer -> min_length += replen - 1 ;
41954195 writer -> overallocate = 1 ;
4196+ if (_PyUnicodeWriter_Prepare (writer , writer -> min_length ,
4197+ PyUnicode_MAX_CHAR_VALUE (repunicode )) == -1 )
4198+ goto onError ;
4199+ }
41964200 if (_PyUnicodeWriter_WriteStr (writer , repunicode ) == -1 )
41974201 goto onError ;
41984202
You can’t perform that action at this time.
0 commit comments