Coverage Report

Created: 2023-09-25 07:00

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