File: fuzz.c

package info (click to toggle)
libdeflate 1.23-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: ansic: 11,716; sh: 1,388; python: 169; makefile: 31
file content (19 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <libdeflate.h>
#include <stdint.h>
#include <stdlib.h>

/* Fuzz zlib decompression. */
int LLVMFuzzerTestOneInput(const uint8_t *in, size_t insize)
{
	size_t outsize_avail = 3 * insize;
	uint8_t *out;
	struct libdeflate_decompressor *d;

	out = malloc(outsize_avail);

	d = libdeflate_alloc_decompressor();
	libdeflate_zlib_decompress(d, in, insize, out, outsize_avail, NULL);
	libdeflate_free_decompressor(d);
	free(out);
	return 0;
}