2017-10-07 03:48:38 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "igzip_lib.h"
|
|
|
|
|
2024-04-19 18:10:01 +02:00
|
|
|
int
|
|
|
|
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
2017-10-07 03:48:38 +02:00
|
|
|
{
|
2024-04-19 18:10:01 +02:00
|
|
|
struct inflate_state state;
|
|
|
|
uint8_t *isal_out_buf = (uint8_t *) (malloc(size * 2));
|
|
|
|
size_t out_buf_size = 2 * size;
|
2017-10-07 03:48:38 +02:00
|
|
|
|
2024-04-19 18:10:01 +02:00
|
|
|
isal_inflate_init(&state);
|
|
|
|
state.next_in = (uint8_t *) data;
|
|
|
|
state.avail_in = size;
|
|
|
|
state.next_out = isal_out_buf;
|
|
|
|
state.avail_out = out_buf_size;
|
2017-10-07 03:48:38 +02:00
|
|
|
|
2024-04-19 18:10:01 +02:00
|
|
|
isal_inflate_stateless(&state);
|
2017-10-07 03:48:38 +02:00
|
|
|
|
2024-04-19 18:10:01 +02:00
|
|
|
free(isal_out_buf);
|
|
|
|
return 0;
|
2017-10-07 03:48:38 +02:00
|
|
|
}
|