mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00:00
fe2033b84f
Add a new fuzz target that exercises the parsing of git configs. The existing git_config_from_mem function is a perfect entry point for fuzzing as it exercises the same code paths as the rest of the config parsing functions and offers an easily fuzzable interface. Config parsing is a useful thing to fuzz because it operates on user controlled data and is a central component of many git operations. Signed-off-by: Brian C Tracy <brian.tracy33@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 lines
408 B
Bash
Executable file
19 lines
408 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Build and test Git's fuzzers
|
|
#
|
|
|
|
. ${0%/*}/lib.sh
|
|
|
|
group "Build fuzzers" make \
|
|
CC=clang \
|
|
CXX=clang++ \
|
|
CFLAGS="-fsanitize=fuzzer-no-link,address" \
|
|
LIB_FUZZING_ENGINE="-fsanitize=fuzzer,address" \
|
|
fuzz-all
|
|
|
|
for fuzzer in commit-graph config date pack-headers pack-idx ; do
|
|
begin_group "fuzz-$fuzzer"
|
|
./oss-fuzz/fuzz-$fuzzer -verbosity=0 -runs=1 || exit 1
|
|
end_group "fuzz-$fuzzer"
|
|
done
|