]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
fuzzer-standalone-loader.c: add comments
authorGuido Vranken <guidovranken@gmail.com>
Sun, 13 Aug 2017 01:11:03 +0000 (03:11 +0200)
committerGuido Vranken <guidovranken@gmail.com>
Sun, 13 Aug 2017 01:11:03 +0000 (03:11 +0200)
src/openvpn/fuzzer-standalone-loader.c

index c7382878e0ab76e0de606e91e78624ed901f5400..9c1c9a37770fcdbfbd74a6649bc4fda6d9e9f2a1 100644 (file)
@@ -3,6 +3,20 @@
 #include <sys/stat.h>
 #include <stdint.h>
 
+/* This is a standalone program that loads every file specified
+ * as a command-line argument, and runs LLVMFuzzerTestOneInput
+ * on this data. This function is normally called by libFuzzer
+ * for every input it generates. This standalone program
+ * makes it possible to run just a specific input or inputs.
+ *
+ * This is necessary if you want to test your input files
+ * with MemorySantizer, because libFuzzer doesn't work well
+ * with MemorySanitizer.
+ *
+ * Code inspired by:
+ * https://github.com/openssl/openssl/blob/master/fuzz/test-corpus.c
+ */
+
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
 int LLVMFuzzerInitialize(int *argc, char ***argv);