Web lists-archives.com

Re: [PATCH 1/2] commit-graph, fuzz: Add fuzzer for commit-graph

Junio C Hamano <gitster@xxxxxxxxx> writes:

>> +	if (graph_size < GRAPH_MIN_SIZE)
>> +		return NULL;
>> +
> The load_commit_graph_one() grabbed graph_map out of xmmap() so it
> is guaranteed to be non-NULL, but we need to check graph_map != NULL
> when we're calling this directly from the fuzz tests, exactly in the
> same spirit that we check graph_size above.  Besides, these are to
> make sure future callers won't misuse the API.

Insert "Please check graph_map != NULL here, too." before the above

>>  	data = (const unsigned char *)graph_map;
> And the reset of the function is the same as the original modulo
> jumping to the cleanup_fail label has been replaced with returning
> Looks good.

Of course, s/reset/rest/ is what I meant.