Hash :
92e011a7
Author :
Date :
2019-10-15T16:22:35
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!
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;