mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-26 22:41:03 +08:00
Use CC for fuzzer, not CXX
This commit is contained in:
parent
0beef1d770
commit
0b3f6d6aab
3
Makefile
3
Makefile
@ -75,10 +75,9 @@ musl: RUN = $(DOCKER) mdashnet/cc1
|
||||
unamalgamated: $(HDRS) Makefile test/packed_fs.c
|
||||
$(CC) src/*.c test/packed_fs.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test
|
||||
|
||||
fuzz: WARN += -Wno-deprecated -Wno-vla-extension
|
||||
fuzz: ASAN = -fsanitize=fuzzer,signed-integer-overflow,address,undefined
|
||||
fuzz: mongoose.c mongoose.h Makefile test/fuzz.c
|
||||
$(CXX) test/fuzz.c $(OPTS) $(WARN) $(INCS) $(TFLAGS) $(ASAN) -o fuzzer
|
||||
$(CC) test/fuzz.c $(OPTS) $(WARN) $(INCS) $(TFLAGS) $(ASAN) -o fuzzer
|
||||
$(RUN) ./fuzzer
|
||||
|
||||
fuzz2: mongoose.c mongoose.h Makefile test/fuzz.c
|
||||
|
@ -88,12 +88,16 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
#if defined(MAIN)
|
||||
int main(int argc, char *argv[]) {
|
||||
int res = EXIT_FAILURE;
|
||||
if (argc > 1) {
|
||||
size_t len = 0;
|
||||
char *buf = mg_file_read(&mg_fs_posix, argv[1], &len);
|
||||
if (buf != NULL) LLVMFuzzerTestOneInput((uint8_t *) buf, len);
|
||||
if (buf != NULL) {
|
||||
LLVMFuzzerTestOneInput((uint8_t *) buf, len);
|
||||
res = EXIT_SUCCESS;
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user