Commit adc445e
fix(zstd): bounds-check VarBin length prefixes
buildVarBin and buildScatteredVarBin read a 4-byte length prefix and advanced
the cursor by it with no validation. A crafted decompressed payload with a
negative or oversized length overran the segment, surfacing as a raw
IndexOutOfBoundsException instead of a VortexException. Route every prefix
read through a readVarBinLen helper that range-checks the prefix and its
trailing bytes against the source segment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent feac99b commit adc445e
1 file changed
Lines changed: 19 additions & 2 deletions
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
250 | 267 | | |
251 | 268 | | |
252 | 269 | | |
253 | 270 | | |
254 | | - | |
| 271 | + | |
255 | 272 | | |
256 | 273 | | |
257 | 274 | | |
| |||
0 commit comments