]> git.proxmox.com Git - libgit2.git/blobdiff - fuzzers/standalone_driver.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / fuzzers / standalone_driver.c
index 90e7013339c63df777b96099e224e4d729a4fcae..cd4f71751ae52a133df69d5dbc6e0e8f8577a8d5 100644 (file)
 #include "futils.h"
 #include "path.h"
 
-extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
-extern int LLVMFuzzerInitialize(int *argc, char ***argv);
+#include "standalone_driver.h"
 
 static int run_one_file(const char *filename)
 {
-       git_buf buf = GIT_BUF_INIT;
+       git_str buf = GIT_STR_INIT;
        int error = 0;
 
        if (git_futils_readbuffer(&buf, filename) < 0) {
@@ -27,7 +26,7 @@ static int run_one_file(const char *filename)
 
        LLVMFuzzerTestOneInput((const unsigned char *)buf.ptr, buf.size);
 exit:
-       git_buf_dispose(&buf);
+       git_str_dispose(&buf);
        return error;
 }
 
@@ -52,7 +51,7 @@ int main(int argc, char **argv)
        fprintf(stderr, "Running %s against %s\n", argv[0], argv[1]);
        LLVMFuzzerInitialize(&argc, &argv);
 
-       if (git_path_dirload(&corpus_files, argv[1], 0, 0x0) < 0) {
+       if (git_fs_path_dirload(&corpus_files, argv[1], 0, 0x0) < 0) {
                fprintf(stderr, "Failed to scan corpus directory '%s': %s\n",
                        argv[1], git_error_last()->message);
                error = -1;