blob: b5f22e845584d0f45caa9c4b4a2eb04f5c33da1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include "igzip_lib.h"
int LLVMFuzzerTestOneInput(const uint8_t * data, size_t size)
{
struct inflate_state state;
uint8_t *isal_out_buf = (uint8_t *) (malloc(size * 2));
size_t out_buf_size = 2 * size;
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;
isal_inflate_stateless(&state);
free(isal_out_buf);
return 0;
}
|