summaryrefslogtreecommitdiff
path: root/fuzzers/corpora/patch_parse/edit-file.diff
diff options
context:
space:
mode:
authorAugie Fackler <augie@google.com>2019-10-15 16:22:35 -0400
committerAugie Fackler <augie@google.com>2019-10-17 15:02:36 -0400
commit92e011a715e8935f2c64c410625dc6911b6e616c (patch)
treeba143126c47b465661e6b1bc2de587714754eac9 /fuzzers/corpora/patch_parse/edit-file.diff
parentef5a3851fdece852569ffebf3537883223744a7a (diff)
downloadlibgit2-92e011a715e8935f2c64c410625dc6911b6e616c.tar.gz
fuzzers: add a new fuzzer for patch parsing
I was looking at this code anyway because the sr.ht people nerdsniped me, and it gave me that "I should fuzz this" feeling. So have a fuzzer!
Diffstat (limited to 'fuzzers/corpora/patch_parse/edit-file.diff')
-rw-r--r--fuzzers/corpora/patch_parse/edit-file.diff13
1 files changed, 13 insertions, 0 deletions
diff --git a/fuzzers/corpora/patch_parse/edit-file.diff b/fuzzers/corpora/patch_parse/edit-file.diff
new file mode 100644
index 000000000..d9e783a7f
--- /dev/null
+++ b/fuzzers/corpora/patch_parse/edit-file.diff
@@ -0,0 +1,13 @@
+diff --git a/fuzzers/patch_fuzzer.c b/fuzzers/patch_fuzzer.c
+index 76186b6fb..f7ce73ac8 100644
+--- a/fuzzers/patch_fuzzer.c
++++ b/fuzzers/patch_fuzzer.c
+@@ -32,7 +32,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+ git_patch* patch;
+ git_patch_options opts = {(uint32_t)data[0]};
+ int status = git_patch_from_buffer(&patch, (const char*)data+1, size-1, &opts);
+- if (status == 0 && patch) {
++ if (patch) {
+ git_patch_free(patch);
+ }
+ return 0;