Repository navigation
Commit 30caa67
Fix std::bad_alloc in C++ blob API with oversized map/array counts
The fuzz_blob_corpus runner crashed on the new overflow corpus files
because the C++ Blob API (merge_patch, each_iter, tree_walk) attempted
to allocate vectors sized by the raw MAP32/ARRAY32 count without first
checking whether that count is plausible given the available data.
Added sanity checks before vector allocations and loops that reject
element counts exceeding the remaining data capacity.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 2466005 commit 30caa67
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
| 975 | + | |
| 976 | + | |
975 | 977 | | |
976 | 978 | | |
977 | 979 | | |
| |||
1458 | 1460 | | |
1459 | 1461 | | |
1460 | 1462 | | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1461 | 1469 | | |
1462 | 1470 | | |
1463 | 1471 | | |
| |||
1532 | 1540 | | |
1533 | 1541 | | |
1534 | 1542 | | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1535 | 1549 | | |
1536 | 1550 | | |
1537 | 1551 | | |
| |||
0 commit comments