Commit 707fca2
fix(reader): reject a negative delta element count on its own
Self-review follow-up on #338. `rowCount > deltasLen - offset` was the
only thing standing between a negative `deltas_len` and the chunk loop,
and the subtraction wraps: `Long.MIN_VALUE - 1` is positive, so the
window check passed, the chunk range came out empty, and decode handed
back a zero-filled array of the requested length. A malformed file
answered instead of rejected — no raw exception, so ADR 0003 held, but
the file is still garbage and should say so.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 2ee7d87 commit 707fca2
2 files changed
Lines changed: 7 additions & 2 deletions
File tree
- reader/src
- main/java/io/github/dfa1/vortex/reader/decode
- test/java/io/github/dfa1/vortex/reader/decode
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
0 commit comments