mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
fuzzers: declare standalone functions
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include "hash.h"
|
||||
#include "commit_graph.h"
|
||||
|
||||
#include "standalone_driver.h"
|
||||
|
||||
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
||||
{
|
||||
GIT_UNUSED(argc);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "git2/sys/transport.h"
|
||||
#include "futils.h"
|
||||
|
||||
#include "standalone_driver.h"
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
struct fuzzer_buffer {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "hash.h"
|
||||
#include "midx.h"
|
||||
|
||||
#include "standalone_driver.h"
|
||||
|
||||
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
||||
{
|
||||
GIT_UNUSED(argc);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
14
fuzzers/standalone_driver.h
Normal file
14
fuzzers/standalone_driver.h
Normal 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
|
||||
Reference in New Issue
Block a user