Check that dest is valid for decompression (#3555)

* add check for valid dest buffer and fuzz on random dest ptr when malloc 0

* add uptrval to linux-kernel

* remove bin files

* get rid of uptrval

* restrict max pointer value check to platforms where sizeof(size_t) == sizeof(void*)
This commit is contained in:
daniellerozenblit
2023-03-31 23:00:55 -07:00
committed by GitHub
parent 7b828aaeb5
commit fcaf06ddb4
6 changed files with 32 additions and 3 deletions
+7
View File
@@ -19,6 +19,7 @@
#include "fuzz.h"
#include "xxhash.h"
#include "zstd.h"
#include "fuzz_data_producer.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -62,6 +63,12 @@ extern "C" {
*/
void* FUZZ_malloc(size_t size);
/**
* malloc except returns random pointer for zero sized data and FUZZ_ASSERT
* that malloc doesn't fail.
*/
void* FUZZ_malloc_rand(size_t size, FUZZ_dataProducer_t *producer);
/**
* memcmp but accepts NULL.
*/