]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
fuzzer-route.c: add some comments
authorGuido Vranken <guidovranken@gmail.com>
Thu, 10 Aug 2017 23:45:27 +0000 (01:45 +0200)
committerGuido Vranken <guidovranken@gmail.com>
Thu, 10 Aug 2017 23:45:27 +0000 (01:45 +0200)
src/openvpn/fuzzer-route.c

index 1c81900efb48d4bc124f7a1e3ffdb376af920173..908350e10ed059465ed7f7583169006b1e8876ac 100644 (file)
@@ -5,6 +5,11 @@
 #include "route.h"
 #include "buffer.h"
 
+/* Start of serialization of struct route_list, route_ipv6_list
+ * 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_route_bypass(struct route_bypass* bypass)
 {
     test_undefined_memory(bypass->bypass, bypass->n_bypass * sizeof(bypass->bypass[0]));
@@ -123,10 +128,13 @@ static void serialize_route6_list(struct route_ipv6_list* rl6)
     }
 }
 
+/* End of serialization of struct route_list, route_ipv6_list */
+
 int LLVMFuzzerInitialize(int *argc, char ***argv)
 {
     return 1;
 }
+
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 {
     struct buffer buf;
@@ -280,6 +288,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 
     }
 cleanup:
+
 #ifdef MSAN
     if ( route_list_inited == true )
     {
@@ -290,6 +299,7 @@ cleanup:
         serialize_route6_list(&rl6);
     }
 #endif
+
     gc_free(&rl.gc);
     getaddrinfo_free_all();
     gc_free(&gc);