1 #include "git-compat-util.h"
4 int LLVMFuzzerTestOneInput(const uint8_t *, size_t);
5 static int config_parser_callback(const char *, const char *,
6 const struct config_context
*, void *);
8 static int config_parser_callback(const char *key
, const char *value
,
9 const struct config_context
*ctx UNUSED
,
13 * Visit every byte of memory we are given to make sure the parser
14 * gave it to us appropriately. We need to unconditionally return 0,
15 * but we also want to prevent the strlen from being optimized away.
17 size_t c
= strlen(key
);
24 int LLVMFuzzerTestOneInput(const uint8_t *data
, const size_t size
)
26 struct config_options config_opts
= { 0 };
28 config_opts
.error_action
= CONFIG_ERROR_SILENT
;
29 git_config_from_mem(config_parser_callback
, CONFIG_ORIGIN_BLOB
,
30 "fuzztest-config", (const char *)data
, size
, NULL
,
31 CONFIG_SCOPE_UNKNOWN
, &config_opts
);