commit-graph: fix buffer read-overflow
authorJosh Steadmon <steadmon@google.com>
Tue, 15 Jan 2019 22:25:51 +0000 (14:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jan 2019 04:32:00 +0000 (20:32 -0800)
commitd2b86fbaa1f6c0606330caf3cc3fdf8984ddc66a
tree7c05e504d723791d208b863e848a41a35e3f20fe
parentaa658574bfcbe03f5703458ac10be1ef3f5f5472
commit-graph: fix buffer read-overflow

fuzz-commit-graph identified a case where Git will read past the end of
a buffer containing a commit graph if the graph's header has an
incorrect chunk count. A simple bounds check in parse_commit_graph()
prevents this.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
t/t5318-commit-graph.sh