Commit graph

2 commits

Author SHA1 Message Date
Josh Steadmon 249dc53444 fuzz-commit-graph: initialize repo object
Various #DEFINE "constants" in commit-graph.c now depend on
the_hash_algo->rawsz, but this object must be initialized before it can
be used.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-02-07 13:02:26 -08:00
Josh Steadmon aa658574bf commit-graph, fuzz: add fuzzer for commit-graph
Break load_commit_graph_one() into a new function, parse_commit_graph().
The latter function operates on arbitrary buffers, which makes it
suitable as a fuzzing target. Since parse_commit_graph() is only called
by load_commit_graph_one() (and the fuzzer described below), we omit
error messages that would be duplicated by the caller.

Adds fuzz-commit-graph.c, which provides a fuzzing entry point
compatible with libFuzzer (and possibly other fuzzing engines).

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-15 20:31:49 -08:00