git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fuzz-commit-graph: properly free graph struct

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 5, 2020, 23:02 UTC
Message-ID
<20200605230233.GA167014@google.com>
In-Reply-To
<35063a0ab4edbaa5bd5b0138e6a6a5b36a8664c5.1591397562.git.steadmon@google.com>
Josh Steadmon wrote:
Show 8 quoted lines
> Use the provided free_commit_graph() to properly free the commit graph
> in fuzz-commit-graph. Otherwise, the fuzzer itself leaks memory when the
> struct contains pointers to allocated memory.
>
> Signed-off-by: Josh Steadmon <steadmon@google.com>
> ---
>  fuzz-commit-graph.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
How can I reproduce this?
Show 10 quoted lines
> diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c
> index 9fd1c04edd..430817214d 100644
> --- a/fuzz-commit-graph.c
> +++ b/fuzz-commit-graph.c
> @@ -12,7 +12,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
>  	initialize_the_repository();
>  	g = parse_commit_graph((void *)data, size);
>  	repo_clear(the_repository);
> -	free(g);
> +	free_commit_graph(g);
In any event, the patch itself is sensible, so
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
Previous: Josh SteadmonNext: Josh Steadmon
Message 2 of 3 in “fuzz-commit-graph: properly free graph struct”
  1. fuzz-commit-graph: properly free graph structJosh Steadmon, Jun 5, 2020
  2. Jonathan NiederJun 5, 2020
  3. Josh SteadmonJun 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.