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 @@ -4256,7 +4256,7 @@ unicode_decode_call_errorhandler_writer(
4256
4256
}
4257
4257
if (need_to_grow ) {
4258
4258
writer -> overallocate = 1 ;
4259
- if (_PyUnicodeWriter_Prepare (writer , writer -> min_length ,
4259
+ if (_PyUnicodeWriter_Prepare (writer , writer -> min_length - writer -> pos ,
4260
4260
PyUnicode_MAX_CHAR_VALUE (repunicode )) == -1 )
4261
4261
goto onError ;
4262
4262
}
@@ -6085,9 +6085,7 @@ _PyUnicode_DecodeUnicodeEscape(const char *s,
6085
6085
& writer )) {
6086
6086
goto onError ;
6087
6087
}
6088
- if (_PyUnicodeWriter_Prepare (& writer , writer .min_length , 127 ) < 0 ) {
6089
- goto onError ;
6090
- }
6088
+ assert (end - s <= writer .size - writer .pos );
6091
6089
6092
6090
#undef WRITE_ASCII_CHAR
6093
6091
#undef WRITE_CHAR
@@ -6364,9 +6362,7 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
6364
6362
& writer )) {
6365
6363
goto onError ;
6366
6364
}
6367
- if (_PyUnicodeWriter_Prepare (& writer , writer .min_length , 127 ) < 0 ) {
6368
- goto onError ;
6369
- }
6365
+ assert (end - s <= writer .size - writer .pos );
6370
6366
6371
6367
#undef WRITE_CHAR
6372
6368
}
You can’t perform that action at this time.
0 commit comments