summaryrefslogtreecommitdiffstats
path: root/fuzz-commit-graph.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:49:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:49:36 +0000
commit5ec6074f0633939fd17d94111d10c6c6b062978c (patch)
treebfaa17b5a64abc66c918e9c70969e519d9e1df8e /fuzz-commit-graph.c
parentInitial commit. (diff)
downloadgit-upstream/1%2.30.2.tar.xz
git-upstream/1%2.30.2.zip
Adding upstream version 1:2.30.2.upstream/1%2.30.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fuzz-commit-graph.c')
-rw-r--r--fuzz-commit-graph.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c
new file mode 100644
index 0000000..e7cf6d5
--- /dev/null
+++ b/fuzz-commit-graph.c
@@ -0,0 +1,19 @@
+#include "commit-graph.h"
+#include "repository.h"
+
+struct commit_graph *parse_commit_graph(struct repository *r,
+ void *graph_map, size_t graph_size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ struct commit_graph *g;
+
+ initialize_the_repository();
+ g = parse_commit_graph(the_repository, (void *)data, size);
+ repo_clear(the_repository);
+ free_commit_graph(g);
+
+ return 0;
+}