Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Decompression] Fail gracefully when out of memory
This patch adds failing gracefully when running out of memory when allocating a buffer for decompression. This provides a work-around for: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3224 Differential revision: https://reviews.llvm.org/D37447 llvm-svn: 312526
- Loading branch information
1 parent
108f36d
commit 0992d38
Showing
4 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+6.69 KB
llvm/test/DebugInfo/Inputs/dwarfdump-decompression-invalid-size.elf-x86-64
Binary file not shown.
13 changes: 13 additions & 0 deletions
13
llvm/test/DebugInfo/dwarfdump-decompression-invalid-size.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// dwarfdump-decompression-invalid-size.elf-x86-64 is prepared using following | ||
// source code and invocation: | ||
// test.cpp: | ||
// int main() { return 0; } | ||
// | ||
// gcc test.cpp -o out -g -Wl,--compress-debug-sections,zlib | ||
// | ||
// After that result object was modified manually. Decompressed size of | ||
// .debug_frame section was changed to 0xffffffffffffffff in compression | ||
// header. | ||
RUN: not llvm-dwarfdump %p/Inputs/dwarfdump-decompression-invalid-size.elf-x86-64 2>&1 | FileCheck %s | ||
|
||
CHECK: decompression of '.debug_frame' failed: unable to allocate 18446744073709551615 bytes. |