From: Guido Vranken Date: Thu, 10 Aug 2017 22:27:40 +0000 (+0200) Subject: fuzzer-mroute.c: add comments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e54397299eddc9cab8eb0ae1731689d46ef83f41;p=thirdparty%2Fopenvpn.git fuzzer-mroute.c: add comments --- diff --git a/src/openvpn/fuzzer-mroute.c b/src/openvpn/fuzzer-mroute.c index e1e53a1cb..9fee74e05 100644 --- a/src/openvpn/fuzzer-mroute.c +++ b/src/openvpn/fuzzer-mroute.c @@ -6,6 +6,10 @@ #include "socket.h" #include "buffer.h" +/* Start of serialization of struct mroute_helper. + * This is necessary to test whether the data structure contains + * any uninitialized data. If it does, MemorySanitizer will detect + * it upon serialization */ static void serialize_mroute_helper(struct mroute_helper* mh) { test_undefined_memory(&mh->cache_generation, sizeof(mh->cache_generation)); @@ -15,10 +19,13 @@ static void serialize_mroute_helper(struct mroute_helper* mh) test_undefined_memory(&mh->net_len_refcount, mh->n_net_len * sizeof(mh->net_len_refcount[0])); } +/* End of serialization of struct mroute_helper. */ + int LLVMFuzzerInitialize(int *argc, char ***argv) { return 1; } + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { struct mroute_addr src, dest, esrc, edest;