Repository navigation
Commit 4254f29
Reject ext32 length 0xffffffff in the C unpacker
The trail length of an ext value includes the typecode byte, so
0xffffffff + 1 wrapped to zero in 32-bit arithmetic. Unpacker.skip()
then treated the 5-byte ext32 header as a complete object and parsed
the remaining bytes as the next object. unpack() was already rejected
by the max_ext_len check, but with a confusing "0 exceeds" message.
Raise ValueError before adding the typecode byte.
Reported by Oz Kaiser (@tatikoma).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent c14af4b commit 4254f29
2 files changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| |||
0 commit comments