git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Subject: Memory Leak vulnerability in reftable/readwrite_test.c
@ 2025-03-01  6:07 H Z
  2025-03-01  6:10 ` H Z
  2025-03-01 11:31 ` René Scharfe
  0 siblings, 2 replies; 7+ messages in thread
From: H Z @ 2025-03-01  6:07 UTC (permalink / raw)
  To: git

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!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-04 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01  6:07 Subject: Memory Leak vulnerability in reftable/readwrite_test.c H Z
2025-03-01  6:10 ` H Z
2025-03-01 11:31 ` René Scharfe
2025-03-01 11:34   ` H Z
2025-03-04  6:33   ` Jeff King
2025-03-04  7:39     ` H Z
2025-03-04 16:11     ` [PATCH v2] reftable: release name on reftable_reader_new() error René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).