File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ Core and Builtins
1717- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
1818 finding the bug and providing a patch.
1919
20- - Issue #12973: Fix overflow check that relied on undefined behaviour in
21- list_repeat. This bug caused test_list to fail with recent versions
22- of Clang.
20+ - Issue #12973: Fix overflow checks that relied on undefined behaviour in
21+ list_repeat (listobject.c) and islice_next (itertoolsmodule.c). These bugs
22+ caused test failures with recent versions of Clang.
2323
2424- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
2525 mapped to POSIX errno ENOTDIR (previously EINVAL).
Original file line number Diff line number Diff line change @@ -1234,7 +1234,9 @@ islice_next(isliceobject *lz)
12341234 return NULL ;
12351235 lz -> cnt ++ ;
12361236 oldnext = lz -> next ;
1237- lz -> next += lz -> step ;
1237+ /* The (size_t) cast below avoids the danger of undefined
1238+ behaviour from signed integer overflow. */
1239+ lz -> next += (size_t )lz -> step ;
12381240 if (lz -> next < oldnext || (stop != -1 && lz -> next > stop ))
12391241 lz -> next = stop ;
12401242 return item ;
You can’t perform that action at this time.
0 commit comments