/src/zlib_uncompress2_fuzzer.cc
Line | Count | Source |
1 | | #include <stddef.h> |
2 | | #include <stdint.h> |
3 | | #include <string.h> |
4 | | |
5 | | #include "zlib.h" |
6 | | |
7 | | static Bytef buffer[256 * 1024] = { 0 }; |
8 | | |
9 | | // Entry point for LibFuzzer. |
10 | 1.56k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
11 | 1.56k | uLongf buffer_length = static_cast<uLongf>(sizeof(buffer)); |
12 | 1.56k | uLong buf_size = static_cast<uLong>(size); |
13 | | // Ignore return code. |
14 | 1.56k | uncompress2(buffer, &buffer_length, data, &buf_size); |
15 | 1.56k | return 0; |
16 | 1.56k | } |