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

Subject: Null pointer dereference vulnerability in src/read-cache.h

From
HZH Z <shiyuyuranzh@gmail.com>
Date
Mar 1, 2025, 06:43 UTC
Message-ID
<CAAJd+faaEsTVqfTH=EsjXu8kneP1ZAASCCoaqp9zuODjSnDatw@mail.gmail.com>

Hi, I am a static analysis tool developer, and I have found a potential null pointer dereference bug in src/read-cache.h 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.

Below is the execution sequence of the program that may produce the bug. First, in the file diff-lib.c, the function oneway_diff assigns tree to NULL on line 537. Second, if on line 540, idx ? idx : tree conditional judgement is false, tree, which is NULL, is passed as the 2nd argument to the function ce_path_match. Third, in file read-cache.h, the parameter ce of function ce_path_match is assigned to NULL. and ce is dereferenced on line 41, resulting in a null pointer dereference vulnerability.

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 src/read-cache.h”
  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.