commit-graph: fix buffer read-overflow