ossfuzz: add fuzzers

This commit is contained in:
Randy
2020-07-07 13:08:22 +02:00
parent 4159f8c8c3
commit 436d915546
5 changed files with 216 additions and 0 deletions

20
tests/uncompress_fuzzer.c Normal file
View File

@@ -0,0 +1,20 @@
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
static unsigned char buffer[256 * 1024] = { 0 };
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
unsigned long int buffer_length = sizeof(buffer);
if (Z_OK != uncompress(buffer, &buffer_length, data, size))) return 0;
return 0;
}