-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fuzz target, fix heap-buffer-overflow issue
- Loading branch information
Pascal Seitz
committed
Oct 19, 2020
1 parent
f66fc4f
commit ce92fbf
Showing
6 changed files
with
31 additions
and
8 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
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
File renamed without changes.
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,12 @@ | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
use lz4_flex::block::decompress::decompress_size_prepended; | ||
use lz4::block::compress as lz4_linked_block_compress; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
// fuzzed code goes here | ||
let compressed = lz4_linked_block_compress(data, None, true).unwrap(); | ||
let decompressed = decompress_size_prepended(&compressed).unwrap(); | ||
assert_eq!(data, decompressed); | ||
}); |
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