aboutsummaryrefslogtreecommitdiffstats
path: root/oss-fuzz/dummy-cmd-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'oss-fuzz/dummy-cmd-main.c')
-rw-r--r--oss-fuzz/dummy-cmd-main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/oss-fuzz/dummy-cmd-main.c b/oss-fuzz/dummy-cmd-main.c
new file mode 100644
index 0000000000..071cb231ba
--- /dev/null
+++ b/oss-fuzz/dummy-cmd-main.c
@@ -0,0 +1,14 @@
+#include "git-compat-util.h"
+
+/*
+ * When linking the fuzzers, we link against common-main.o to pick up some
+ * symbols. However, even though we ignore common-main:main(), we still need to
+ * provide all the symbols it references. In the fuzzers' case, we need to
+ * provide a dummy cmd_main() for the linker to be happy. It will never be
+ * executed.
+ */
+
+int cmd_main(int argc, const char **argv) {
+ BUG("We should not execute cmd_main() from a fuzz target");
+ return 1;
+}