# HG changeset patch # User Matt Johnston # Date 1604320428 -28800 # Node ID 8179eabe16c9873e9b88635784a35452385dd833 # Parent 833bf9947603c0a7f3a9a0d22fe77f90b2e53de4 fuzzing - fix some wrong types and -lcrypt on macos diff -r 833bf9947603 -r 8179eabe16c9 Makefile.in --- a/Makefile.in Sun Nov 01 23:44:58 2020 +0800 +++ b/Makefile.in Mon Nov 02 20:33:48 2020 +0800 @@ -290,7 +290,7 @@ fuzz-targets: $(FUZZ_TARGETS) $(FUZZER_OPTIONS) $(FUZZ_TARGETS): $(FUZZ_OBJS) $(allobjs) $(LIBTOM_DEPS) - $(CXX) $(CXXFLAGS) fuzz/$@.o $(LDFLAGS) $(allobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) -lcrypt + $(CXX) $(CXXFLAGS) fuzz/$@.o $(LDFLAGS) $(allobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ # fuzzers that use the custom mutator - these expect a SSH network stream MUTATOR_FUZZERS=fuzzer-client fuzzer-client_nomaths \ diff -r 833bf9947603 -r 8179eabe16c9 fuzz/fuzz-common.c --- a/fuzz/fuzz-common.c Sun Nov 01 23:44:58 2020 +0800 +++ b/fuzz/fuzz-common.c Mon Nov 02 20:33:48 2020 +0800 @@ -239,7 +239,7 @@ } uint32_t wrapseed; - genrandom(&wrapseed, sizeof(wrapseed)); + genrandom((void*)&wrapseed, sizeof(wrapseed)); wrapfd_setseed(wrapseed); int fakesock = wrapfd_new(); @@ -275,7 +275,7 @@ ses.kexstate.donefirstkex = 1; uint32_t wrapseed; - genrandom(&wrapseed, sizeof(wrapseed)); + genrandom((void*)&wrapseed, sizeof(wrapseed)); wrapfd_setseed(wrapseed); int fakesock = wrapfd_new(); diff -r 833bf9947603 -r 8179eabe16c9 fuzz/fuzz-harness.c --- a/fuzz/fuzz-harness.c Sun Nov 01 23:44:58 2020 +0800 +++ b/fuzz/fuzz-harness.c Mon Nov 02 20:33:48 2020 +0800 @@ -47,7 +47,8 @@ return 0; } -size_t LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) { +// Just to let it link +size_t LLVMFuzzerMutate(uint8_t *UNUSED(Data), size_t UNUSED(Size), size_t UNUSED(MaxSize)) { printf("standalone fuzzer harness shouldn't call LLVMFuzzerMutate"); abort(); return 0; diff -r 833bf9947603 -r 8179eabe16c9 fuzz/fuzz-sshpacketmutator.c --- a/fuzz/fuzz-sshpacketmutator.c Sun Nov 01 23:44:58 2020 +0800 +++ b/fuzz/fuzz-sshpacketmutator.c Mon Nov 02 20:33:48 2020 +0800 @@ -285,7 +285,7 @@ unsigned int num_out = min_out + nrand48(randstate) % (max_out-min_out+1); for (i = 0; i < num_out; i++) { - int choose = nrand48(randstate) % (num_packets1 + num_packets2); + unsigned int choose = nrand48(randstate) % (num_packets1 + num_packets2); buffer *p = NULL; if (choose < num_packets1) { p = packets1[choose];