File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -4500,7 +4500,7 @@ unicode_decode_call_errorhandler_writer(
4500
4500
}
4501
4501
if (need_to_grow ) {
4502
4502
writer -> overallocate = 1 ;
4503
- if (_PyUnicodeWriter_Prepare (writer , writer -> min_length ,
4503
+ if (_PyUnicodeWriter_Prepare (writer , writer -> min_length - writer -> pos ,
4504
4504
PyUnicode_MAX_CHAR_VALUE (repunicode )) == -1 )
4505
4505
goto onError ;
4506
4506
}
@@ -6176,9 +6176,7 @@ _PyUnicode_DecodeUnicodeEscape(const char *s,
6176
6176
& writer )) {
6177
6177
goto onError ;
6178
6178
}
6179
- if (_PyUnicodeWriter_Prepare (& writer , writer .min_length , 127 ) < 0 ) {
6180
- goto onError ;
6181
- }
6179
+ assert (end - s <= writer .size - writer .pos );
6182
6180
6183
6181
#undef WRITE_ASCII_CHAR
6184
6182
#undef WRITE_CHAR
@@ -6455,9 +6453,7 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
6455
6453
& writer )) {
6456
6454
goto onError ;
6457
6455
}
6458
- if (_PyUnicodeWriter_Prepare (& writer , writer .min_length , 127 ) < 0 ) {
6459
- goto onError ;
6460
- }
6456
+ assert (end - s <= writer .size - writer .pos );
6461
6457
6462
6458
#undef WRITE_CHAR
6463
6459
}
You can’t perform that action at this time.
0 commit comments