Repository navigation
Commit 25181ce
Passing an iterator to `bytearray.__init__` didn't take into account
that iterating that iterator could modify the bytearray position and
`ob_start`. When that happened the iterator would write beyond the end
of the allocation.
Update the "enough space" check to account for `ob_start`. The
assignment always included it. Add an assert after append that the
offsets line up as expected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5346059 commit 25181ce
3 files changed
Lines changed: 31 additions & 4 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Security
- Objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2098 | 2098 | | |
2099 | 2099 | | |
2100 | 2100 | | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
2101 | 2117 | | |
2102 | 2118 | | |
2103 | 2119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
1160 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1161 | 1164 | | |
1162 | | - | |
1163 | | - | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1164 | 1170 | | |
1165 | 1171 | | |
1166 | 1172 | | |
1167 | | - | |
| 1173 | + | |
1168 | 1174 | | |
| 1175 | + | |
1169 | 1176 | | |
| 1177 | + | |
| 1178 | + | |
1170 | 1179 | | |
1171 | 1180 | | |
1172 | 1181 | | |
| |||
0 commit comments