Repository navigation
Commit a962606
zstd-safe: refuse to use a Seekable until an init succeeded
zstd only allocates the seek table when an initialization succeeds, and
ZSTD_seekable_decompress() / offsetToFrameIndex() read it unconditionally,
so a fresh Seekable, or one whose init_buff() failed, made them dereference
NULL from safe code. A failed re-initialization also left the old table in
place while the source had already switched to the refused buffer.
Track the result of the last initialization with the existing Poison
helper and guard the methods that reach the table on it.
While here, also guard frame_decompressed_size() (on Seekable and
SeekTable) against frame_index == num_frames(): zstd only rejects
frame_index > num_frames() and otherwise reads one entry past the end of
the seek table.
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-VFQMVXJX.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MxSMUdwqoQ3qm6UF82MgZD1 parent 80506be commit a962606
2 files changed
Lines changed: 113 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
262 | 274 | | |
263 | 275 | | |
264 | 276 | | |
265 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
266 | 287 | | |
267 | 288 | | |
268 | 289 | | |
| |||
284 | 305 | | |
285 | 306 | | |
286 | 307 | | |
| 308 | + | |
287 | 309 | | |
288 | 310 | | |
289 | 311 | | |
| |||
312 | 334 | | |
313 | 335 | | |
314 | 336 | | |
315 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
316 | 341 | | |
317 | 342 | | |
318 | 343 | | |
| |||
329 | 354 | | |
330 | 355 | | |
331 | 356 | | |
| 357 | + | |
332 | 358 | | |
333 | 359 | | |
334 | 360 | | |
| |||
389 | 415 | | |
390 | 416 | | |
391 | 417 | | |
| 418 | + | |
392 | 419 | | |
393 | 420 | | |
394 | 421 | | |
| |||
468 | 495 | | |
469 | 496 | | |
470 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
471 | 504 | | |
472 | 505 | | |
473 | 506 | | |
| |||
479 | 512 | | |
480 | 513 | | |
481 | 514 | | |
| 515 | + | |
| 516 | + | |
482 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
483 | 521 | | |
484 | 522 | | |
485 | 523 | | |
| |||
570 | 608 | | |
571 | 609 | | |
572 | 610 | | |
573 | | - | |
| 611 | + | |
574 | 612 | | |
575 | 613 | | |
576 | 614 | | |
| |||
598 | 636 | | |
599 | 637 | | |
600 | 638 | | |
| 639 | + | |
601 | 640 | | |
602 | 641 | | |
603 | 642 | | |
| |||
770 | 809 | | |
771 | 810 | | |
772 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
773 | 816 | | |
774 | 817 | | |
775 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
258 | 265 | | |
259 | 266 | | |
260 | 267 | | |
| |||
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
266 | 331 | | |
267 | 332 | | |
268 | 333 | | |
| |||
0 commit comments