Commit adf3c6a
committed
ORC-2190: [C++] Reject compressed chunk length exceeding block size in C++ reader
### What changes were proposed in this pull request?
This PR makes the ORC C++ reader reject a compressed chunk whose length exceeds the configured
compression block size, matching the Java reader.
https://github.com/apache/orc/blob/5d3cf1318b58416719e89169ae9d56f758311f7e/java/core/src/java/org/apache/orc/impl/InStream.java#L504-L507
### Why are the changes needed?
The Java reader already performs this check in `InStream.CompressedStream.readHeader`, but the C++
reader was missing it. This is a defense-in-depth hardening (not a CVE): the chunk length is already
bounded to ~8MB by the 3-byte header, but the spec-mandated first check was absent on the C++ side.
Well-formed files are unaffected.
### How was this patch tested?
Pass the CIs with the newly added test case.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 5
Closes #2671 from dongjoon-hyun/ORC-2190.
Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 6015de5)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>1 parent 8e3297a commit adf3c6a
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
422 | 425 | | |
423 | 426 | | |
424 | 427 | | |
| |||
460 | 463 | | |
461 | 464 | | |
462 | 465 | | |
| 466 | + | |
463 | 467 | | |
464 | 468 | | |
465 | 469 | | |
| |||
518 | 522 | | |
519 | 523 | | |
520 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
521 | 531 | | |
522 | 532 | | |
523 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
572 | 585 | | |
573 | 586 | | |
574 | 587 | | |
| |||
0 commit comments