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.
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)10 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
11   uLongf buffer_length = static_cast<uLongf>(sizeof(buffer));
12   uLong buf_size = static_cast<uLong>(size);
13   // Ignore return code.
14   uncompress2(buffer, &buffer_length, data, &buf_size);
15   return 0;
16 }
17