Sha256: cd749241845c81fecefee147972d34707fec5c7499dd52797bb5c548427bc6c6

Contents?: true

Size: 570 Bytes

Versions: 2

Compression:

Stored size: 570 Bytes

Contents

#include <assert.h>
#include <libdeflate.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>

int main(int argc, char **argv)
{
	struct libdeflate_decompressor *d;
	int ret;
	int fd = open(argv[1], O_RDONLY);
	struct stat stbuf;
	assert(fd >= 0);
	ret = fstat(fd, &stbuf);
	assert(!ret);

	char in[stbuf.st_size];
	ret = read(fd, in, sizeof in);
	assert(ret == sizeof in);

	char out[sizeof(in) * 3];

	d = libdeflate_alloc_decompressor();

	libdeflate_zlib_decompress(d, in, sizeof in, out, sizeof out, NULL);
	libdeflate_free_decompressor(d);
	return 0;
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libdeflate-0.1.1 ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/fuzz.c
libdeflate-0.1.0 ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/fuzz.c