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

Re: Ownership handling of the "remote name" buffer given to `remote_get` is inconsistent

From
Mike Hommey <mh@glandium.org>
Date
Jun 19, 2024, 21:24 UTC
Message-ID
<20240619212448.c66nvf6ca745yvux@glandium.org>
In-Reply-To
<20240619204450.GA1527089@coredump.intra.peff.net>
On Wed, Jun 19, 2024 at 04:44:50PM -0400, Jeff King wrote:
Show 15 quoted lines
> On Thu, Jun 20, 2024 at 04:53:11AM +0900, Mike Hommey wrote:
> 
> > When you call `remote_get(name)`, you may end up giving ownership of
> > `name` to the remote, such that if you `free(name)`, using the remote
> > after that may lead to use-after-free. Of course, this is a
> > use-libgit-as-a-library situation; I don't think it happens in actual
> > git code.
> 
> Try this recent series:
> 
>   https://lore.kernel.org/git/20240614102439.GA222287@coredump.intra.peff.net/
> 
> especially patches 2 and 3. Junio has it queued as jk/remote-wo-url.
> Also, you might want to check the later patches to make sure the
> cleanups don't cause any problems for your use case.

What timing! It looks like both these two patches address my issue without breaking anything for me.

Thanks
Mike
Previous: Jeff King
Message 3 of 3 in “Ownership handling of the "remote name" buffer given to `remote_get` is inconsistent”
  1. Mike HommeyJun 19, 2024
  2. Jeff KingJun 19, 2024
  3. Mike HommeyJun 19, 2024

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.