Commit 081e0be
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.
(cherry picked from commit fa0ec86)
Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
1 parent acdb9a7 commit 081e0be
3 files changed
Lines changed: 53 additions & 1 deletion
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules/_io
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4065 | 4065 | | |
4066 | 4066 | | |
4067 | 4067 | | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
| 4110 | + | |
4068 | 4111 | | |
4069 | 4112 | | |
4070 | 4113 | | |
| |||
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 | |
|---|---|---|---|
| |||
2726 | 2726 | | |
2727 | 2727 | | |
2728 | 2728 | | |
2729 | | - | |
| 2729 | + | |
2730 | 2730 | | |
2731 | 2731 | | |
2732 | 2732 | | |
| |||
2778 | 2778 | | |
2779 | 2779 | | |
2780 | 2780 | | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
2781 | 2784 | | |
2782 | 2785 | | |
2783 | 2786 | | |
2784 | 2787 | | |
2785 | 2788 | | |
| 2789 | + | |
2786 | 2790 | | |
2787 | 2791 | | |
2788 | 2792 | | |
| |||
2923 | 2927 | | |
2924 | 2928 | | |
2925 | 2929 | | |
| 2930 | + | |
2926 | 2931 | | |
2927 | 2932 | | |
2928 | 2933 | | |
| |||
2935 | 2940 | | |
2936 | 2941 | | |
2937 | 2942 | | |
| 2943 | + | |
2938 | 2944 | | |
2939 | 2945 | | |
2940 | 2946 | | |
| |||
0 commit comments