Fix fuzzer

This commit is contained in:
cpq 2022-09-29 19:31:52 +01:00
parent 9680b8ccb3
commit 6cf3a3feaf
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ fuzz: mongoose.c mongoose.h Makefile test/fuzz.c
$(RUN) ./fuzzer
fuzz2: mongoose.c mongoose.h Makefile test/fuzz.c
$(CC) test/fuzz.c test/packed_fs.c -DMAIN $(CFLAGS) -o fuzzer
$(CC) test/fuzz.c -DMAIN $(OPTS) $(WARN) $(ASAN) $(INCS) -o fuzzer
$(RUN) ./fuzzer /tmp/fuzzdata
test: Makefile mongoose.h $(SRCS)

View File

@ -58,7 +58,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
mg_json_get(mg_str_n((char *) data, size), "$[0]", &n);
if (size > 0) {
struct mip_cfg cfg = {0};
struct mip_cfg cfg = {{0,0,0,0,0,0}, 0x01020304, 255, 0x01010101};
size_t pktlen = 1540;
char t[sizeof(struct mip_if) + pktlen * 2 + 0 /* qlen */];
struct mip_if *ifp = (struct mip_if *) t;