Commit fa0ec86
authored
TextIOWrapper.tell() used a borrowed next_input from the snapshot across the
decoder's getstate/decode/setstate calls, so a decoder that reenters seek()
from getstate could free it and leave tell() reading freed memory. Own the
reference across those calls, matching the sibling textiowrapper_read_chunk.
1 parent f40043e commit fa0ec86
3 files changed
Lines changed: 53 additions & 1 deletion
File tree
- Lib/test/test_io
- Misc/NEWS.d/next/Library
- Modules/_io
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1610 | 1610 | | |
1611 | 1611 | | |
1612 | 1612 | | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
1613 | 1656 | | |
1614 | 1657 | | |
1615 | 1658 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2823 | 2823 | | |
2824 | 2824 | | |
2825 | 2825 | | |
2826 | | - | |
| 2826 | + | |
2827 | 2827 | | |
2828 | 2828 | | |
2829 | 2829 | | |
| |||
2875 | 2875 | | |
2876 | 2876 | | |
2877 | 2877 | | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
2878 | 2881 | | |
2879 | 2882 | | |
2880 | 2883 | | |
2881 | 2884 | | |
2882 | 2885 | | |
| 2886 | + | |
2883 | 2887 | | |
2884 | 2888 | | |
2885 | 2889 | | |
| |||
3020 | 3024 | | |
3021 | 3025 | | |
3022 | 3026 | | |
| 3027 | + | |
3023 | 3028 | | |
3024 | 3029 | | |
3025 | 3030 | | |
| |||
3032 | 3037 | | |
3033 | 3038 | | |
3034 | 3039 | | |
| 3040 | + | |
3035 | 3041 | | |
3036 | 3042 | | |
3037 | 3043 | | |
| |||
0 commit comments