Repository navigation
Commit 8a4cdd3
authored
Problem: for a size with no struct format code, _read_unpack ran
int.from_bytes on whatever arrived, so a short read returned a smaller
integer where sizes 1, 2, 4 and 8 raise StructError.
Fix: check the length on the int.from_bytes path and raise the same
StructError without quiet; quiet still returns the partial value.
Test: test_read_unpack_short_read_fails_for_every_size.
1 parent 1826870 commit 8a4cdd3
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1767 | 1767 | | |
1768 | 1768 | | |
1769 | 1769 | | |
1770 | | - | |
1771 | | - | |
| 1770 | + | |
1772 | 1771 | | |
1773 | 1772 | | |
1774 | 1773 | | |
| |||
1788 | 1787 | | |
1789 | 1788 | | |
1790 | 1789 | | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1791 | 1794 | | |
1792 | 1795 | | |
1793 | 1796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
237 | 256 | | |
238 | 257 | | |
239 | 258 | | |
| |||
0 commit comments