Commit d3fe3de
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 ccaacd8 commit d3fe3de
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 | |
|---|---|---|---|
| |||
4099 | 4099 | | |
4100 | 4100 | | |
4101 | 4101 | | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
4102 | 4145 | | |
4103 | 4146 | | |
4104 | 4147 | | |
| |||
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 | |
|---|---|---|---|
| |||
2745 | 2745 | | |
2746 | 2746 | | |
2747 | 2747 | | |
2748 | | - | |
| 2748 | + | |
2749 | 2749 | | |
2750 | 2750 | | |
2751 | 2751 | | |
| |||
2797 | 2797 | | |
2798 | 2798 | | |
2799 | 2799 | | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
2800 | 2803 | | |
2801 | 2804 | | |
2802 | 2805 | | |
2803 | 2806 | | |
2804 | 2807 | | |
| 2808 | + | |
2805 | 2809 | | |
2806 | 2810 | | |
2807 | 2811 | | |
| |||
2942 | 2946 | | |
2943 | 2947 | | |
2944 | 2948 | | |
| 2949 | + | |
2945 | 2950 | | |
2946 | 2951 | | |
2947 | 2952 | | |
| |||
2954 | 2959 | | |
2955 | 2960 | | |
2956 | 2961 | | |
| 2962 | + | |
2957 | 2963 | | |
2958 | 2964 | | |
2959 | 2965 | | |
| |||
0 commit comments