Skip to content

Commit 564ba70

Browse files
authored
Update Python/codecs.c
1 parent 08be0a7 commit 564ba70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
906906
if (end - start > PY_SSIZE_T_MAX / 10) {
907907
end = start + PY_SSIZE_T_MAX / 10;
908908
}
909-
end = Py_MIN(end, PyUnicode_GET_LENGTH(obj));
909+
end = Py_MIN(end, objlen);
910910

911911
Py_ssize_t ressize = 0;
912912
for (Py_ssize_t i = start; i < end; ++i) {

0 commit comments

Comments
 (0)