Repository navigation
Commit 97ac28d
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.
(cherry picked from commit 25181ce)
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9ed62ac commit 97ac28d
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 | |
|---|---|---|---|
| |||
1814 | 1814 | | |
1815 | 1815 | | |
1816 | 1816 | | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
1817 | 1833 | | |
1818 | 1834 | | |
1819 | 1835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | | - | |
| 1075 | + | |
1076 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1077 | 1080 | | |
1078 | | - | |
1079 | | - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1080 | 1086 | | |
1081 | 1087 | | |
1082 | 1088 | | |
1083 | | - | |
| 1089 | + | |
1084 | 1090 | | |
| 1091 | + | |
1085 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
1086 | 1095 | | |
1087 | 1096 | | |
1088 | 1097 | | |
| |||
0 commit comments