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

Subject: Null pointer dereference vulnerability in commit.c

From
HZH Z <shiyuyuranzh@gmail.com>
Date
Mar 1, 2025, 07:33 UTC
Message-ID
<CAAJd+fZUEo15C29KSk61-P+7x=bjhgQ5iDTdbqV++NY4+iGchA@mail.gmail.com>

Hi, I am a static analysis tool developer, and I have found a potential null pointer dereference bug in commit.c and would like to report it to the maintainers. This vulnerability has the potential to cause unexpected application behavior, crashes. Can you please help me check it? Thank you for your effort and patience!

Below is the execution sequence of the program that may produce the null pointer dereference bug.

First, in the file commit.c, the function pop_commit may assign item to NULL at line 806 if the conditional judgement is false. Second, in file commit.c, function pop_most_recent_commit calls function pop_commit at line 748, which may cause variable ret to be assigned NULL. Finally, ret is dereferenced on line 749, leading to a null pointer dereference vulnerability.

However, in the file merge-ort.c, the function merge_ort_internal calls the function pop_commit on line 5176, and then makes a judgement on whether the return value of pop_commit is NULL or not on line 5177, which suggests that it is indeed possible for pop_commit to return NULL.

Thank you for reviewing this report. I look forward to your response.
Next: René Scharfe
Message 1 of 2 in “Subject: Null pointer dereference vulnerability in commit.c”
  1. H ZMar 1, 2025
  2. René ScharfeMar 1, 2025

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.