Skip to content

Commit c56b525

Browse files
committed
Fix segmentation fault
1 parent 487fdbe commit c56b525

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Objects/unicodeobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,12 +1429,12 @@ _copy_characters(PyObject *to, Py_ssize_t to_start,
14291429
assert(PyUnicode_Check(from));
14301430
assert(from_start + how_many <= PyUnicode_GET_LENGTH(from));
14311431

1432-
assert(PyUnicode_Check(to));
1433-
assert(to_start + how_many <= PyUnicode_GET_LENGTH(to));
1434-
14351432
if (how_many == 0)
14361433
return 0;
14371434

1435+
assert(PyUnicode_Check(to));
1436+
assert(to_start + how_many <= PyUnicode_GET_LENGTH(to));
1437+
14381438
from_kind = PyUnicode_KIND(from);
14391439
from_data = PyUnicode_DATA(from);
14401440
to_kind = PyUnicode_KIND(to);

0 commit comments

Comments
 (0)