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

Re: Subject: Memory Leak vulnerability in reftable/readwrite_test.c

From
HZH Z <shiyuyuranzh@gmail.com>
Date
Mar 1, 2025, 06:10 UTC
Message-ID
<CAAJd+fbNhGa5Pe4x-_rbwXVoye9uBD45zoJtu7riiW7GfnU1Cg@mail.gmail.com>
In-Reply-To
<CAAJd+fZSUiiUm05D_eO3HS7p=WoxAWSZo51dUNjyGjUNJBvyGg@mail.gmail.com>

Also, here's the code path that leads to that memory leak vulnerability, which I've represented with an image.

H Z <shiyuyuranzh@gmail.com> 于2025年3月1日周六 14:07写道:
Show 20 quoted lines
>
> Hi, I have found a potential memory leak bug in
> reftable/readwrite_test.c and would like to report it to the
> maintainers. Can you please help me to check it? Thank you for your
> effort and patience!
>
> Below is the execution sequence of the program that may produce the bug.
>
> First, in file src/wrapper.c, function xstrdup allocates memory at
> line 40 and returns at line 43.
> Second, in the file reftable/reader.c, the function init_reader calls
> the function xstrdup on line 202 to allocate memory for r->name, which
> is the formal parameter of the function init_reader.
> Third, in file reftable/readwrite_test.c, function
> test_corrupt_table_empty calls function init_reader on line 935 with
> &rd passed as the first argument, causing rd->name to be allocated
> memory. rd->name is not freed, which would cause the memory leak
> vulnerability.
>
> Thank you very much for reading and I look forward to hearing from you!
Previous: H ZNext: René Scharfe
Message 2 of 7 in “Subject: Memory Leak vulnerability in reftable/readwrite_test.c”
  1. H ZMar 1, 2025
  2. H ZMar 1, 2025
  3. René ScharfeMar 1, 2025
  4. H ZMar 1, 2025
  5. Jeff KingMar 4, 2025
  6. H ZMar 4, 2025
  7. reftable: release name on reftable_reader_new() errorRené Scharfe, Mar 4, 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.