Repository navigation
Commit 4c2433f
authored
Marshalling a set element can run Python code (__buffer__, an audit
hook) which changes the set. The number of elements was read before
the loop, so a set which grew was written past the end of the list and
one which shrank left NULL items in the list which was then sorted.
Raise RuntimeError("set changed size during iteration") instead.
(cherry picked from commit cd71799)
1 parent b21f041 commit 4c2433f
3 files changed
Lines changed: 47 additions & 1 deletion
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
585 | 608 | | |
586 | 609 | | |
587 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
654 | 659 | | |
| 660 | + | |
655 | 661 | | |
656 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
657 | 668 | | |
658 | 669 | | |
659 | 670 | | |
| |||
673 | 684 | | |
674 | 685 | | |
675 | 686 | | |
676 | | - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
677 | 692 | | |
678 | 693 | | |
679 | 694 | | |
| |||
1941 | 1956 | | |
1942 | 1957 | | |
1943 | 1958 | | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1944 | 1963 | | |
1945 | 1964 | | |
1946 | 1965 | | |
| |||
0 commit comments