fuzzers: declare standalone functions

This commit is contained in:
Edward Thomson
2021-11-11 12:33:14 -05:00
parent 0429894e0b
commit 489aec4447
9 changed files with 29 additions and 2 deletions

View File

@@ -17,6 +17,8 @@
#include "hash.h"
#include "commit_graph.h"
#include "standalone_driver.h"
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
GIT_UNUSED(argc);

View File

@@ -10,6 +10,8 @@
#include "git2.h"
#include "config_backend.h"
#include "standalone_driver.h"
#define UNUSED(x) (void)(x)
int foreach_cb(const git_config_entry *entry, void *payload)

View File

@@ -15,6 +15,8 @@
#include "git2/sys/transport.h"
#include "futils.h"
#include "standalone_driver.h"
#define UNUSED(x) (void)(x)
struct fuzzer_buffer {

View File

@@ -16,6 +16,8 @@
#include "hash.h"
#include "midx.h"
#include "standalone_driver.h"
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
GIT_UNUSED(argc);

View File

@@ -10,6 +10,8 @@
#include "git2.h"
#include "object.h"
#include "standalone_driver.h"
#define UNUSED(x) (void)(x)
int LLVMFuzzerInitialize(int *argc, char ***argv)

View File

@@ -14,6 +14,8 @@
#include "common.h"
#include "str.h"
#include "standalone_driver.h"
static git_odb *odb = NULL;
static git_odb_backend *mempack = NULL;

View File

@@ -11,6 +11,8 @@
#include "patch.h"
#include "patch_parse.h"
#include "standalone_driver.h"
#define UNUSED(x) (void)(x)
int LLVMFuzzerInitialize(int *argc, char ***argv)

View File

@@ -11,8 +11,7 @@
#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)
{

View File

@@ -0,0 +1,14 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_standalone_driver_h__
#define INCLUDE_standalone_driver_h__
extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
extern int LLVMFuzzerInitialize(int *argc, char ***argv);
#endif