Commit 1ccaa02
committed
GH-50380: [C++][Gandiva] check offset bounds before allocating in byte_substr
Move the past-end bounds check ahead of the arena_malloc so an offset
beyond text_len returns early without allocating an output buffer or
risking a spurious OOM error.1 parent ead3d73 commit 1ccaa02
1 file changed
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
2474 | | - | |
2475 | | - | |
2476 | | - | |
2477 | | - | |
2478 | | - | |
2479 | | - | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | 2474 | | |
2484 | 2475 | | |
2485 | 2476 | | |
| |||
2488 | 2479 | | |
2489 | 2480 | | |
2490 | 2481 | | |
2491 | | - | |
| 2482 | + | |
| 2483 | + | |
2492 | 2484 | | |
2493 | 2485 | | |
2494 | 2486 | | |
2495 | 2487 | | |
2496 | 2488 | | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2497 | 2498 | | |
2498 | 2499 | | |
2499 | 2500 | | |
| |||
0 commit comments