Commit 487f148
authored
apacheGH-49837: [C++][Parquet] Avoid unbounded temporary std::vector in DELTA_(LENGTH_)BYTE_ARRAY decoder (apache#49838)
### Rationale for this change
`DeltaLengthByteArrayDecoder::DecodeArrow` and `DeltaByteArrayDecoder::DecodeArrow` both allocate a temporary `std::vector` for the entire range of decoded values.
This generates out-of-memory failures in the Parquet encoding fuzzer as this unbounded allocation bypasses the custom fuzzing memory pool.
This issue was found by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6634166832922624
### What changes are included in this PR?
Use the given MemoryPool to allocate a temporary buffer, so that potential memory limits are applied.
### Are these changes tested?
Yes, using existing tests.
### Are there any user-facing changes?
No.
* GitHub Issue: apache#49837
Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>1 parent 5633a18 commit 487f148
2 files changed
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
| 1719 | + | |
1719 | 1720 | | |
1720 | 1721 | | |
1721 | 1722 | | |
| |||
1804 | 1805 | | |
1805 | 1806 | | |
1806 | 1807 | | |
1807 | | - | |
1808 | | - | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
1809 | 1814 | | |
1810 | 1815 | | |
1811 | 1816 | | |
1812 | 1817 | | |
1813 | 1818 | | |
1814 | 1819 | | |
1815 | | - | |
| 1820 | + | |
1816 | 1821 | | |
1817 | 1822 | | |
1818 | 1823 | | |
| |||
1837 | 1842 | | |
1838 | 1843 | | |
1839 | 1844 | | |
| 1845 | + | |
1840 | 1846 | | |
1841 | 1847 | | |
1842 | 1848 | | |
| |||
2140 | 2146 | | |
2141 | 2147 | | |
2142 | 2148 | | |
2143 | | - | |
2144 | | - | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
2145 | 2155 | | |
2146 | 2156 | | |
2147 | 2157 | | |
2148 | 2158 | | |
2149 | 2159 | | |
2150 | 2160 | | |
2151 | | - | |
| 2161 | + | |
2152 | 2162 | | |
2153 | 2163 | | |
2154 | 2164 | | |
| |||
0 commit comments