summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fuzzers/download_refs_fuzzer.c3
-rw-r--r--fuzzers/packfile_fuzzer.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/fuzzers/download_refs_fuzzer.c b/fuzzers/download_refs_fuzzer.c
index fd10409d4..3807c09b3 100644
--- a/fuzzers/download_refs_fuzzer.c
+++ b/fuzzers/download_refs_fuzzer.c
@@ -174,6 +174,9 @@ int LLVMFuzzerInitialize(int *argc, char ***argv)
if (git_libgit2_init() < 0)
abort();
+ if (git_libgit2_opts(GIT_OPT_SET_PACK_MAX_OBJECTS, 10000000) < 0)
+ abort();
+
if (mkdtemp(tmp) != tmp)
abort();
diff --git a/fuzzers/packfile_fuzzer.c b/fuzzers/packfile_fuzzer.c
index e7708b9be..a59d28330 100644
--- a/fuzzers/packfile_fuzzer.c
+++ b/fuzzers/packfile_fuzzer.c
@@ -33,6 +33,10 @@ int LLVMFuzzerInitialize(int *argc, char ***argv)
fprintf(stderr, "Failed to initialize libgit2\n");
abort();
}
+ if (git_libgit2_opts(GIT_OPT_SET_PACK_MAX_OBJECTS, 10000000) < 0) {
+ fprintf(stderr, "Failed to limit maximum pack object count\n");
+ abort();
+ }
if (git_odb_new(&odb) < 0) {
fprintf(stderr, "Failed to create the odb\n");
abort();