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

Re: Segfault in "git remote show <remote-name>"

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
May 26, 2009, 18:54 UTC
Message-ID
<40aa078e0905261154o7f8901e4k8526c787e0e9d3ac@mail.gmail.com>
In-Reply-To
<20090525190121.GA3979@localhost>
On Mon, May 25, 2009 at 9:01 PM, Clemens Buchacher <drizzd@aon.at> wrote:
Show 7 quoted lines
> Subject: [PATCH] fix segfault showing an empty remote
>
> In case of an empty list, the search for its tail caused a
> NULL-pointer dereference.
>
> Reported-by: Erik Faye-Lund <kusmabite@googlemail.com>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Tested-by: Erik Faye-Lund <kusmabite@googlemail.com>
Show 10 quoted lines
> ---
>
> On Mon, May 25, 2009 at 06:10:12PM +0200, Erik Faye-Lund wrote:
>> I've been messing around a bit, trying to set up a gitosis repo to
>> mirror one of my projects. Now, I added the remote to my project, but
>> when running "git remote show <remote-name>", I'm getting a segfault
>> in builtin-remote.c at line 303 ("while (ref->next)"), because ref
>> itself is NULL.
>
> This should fix it.

Thanks a lot for looking into and fixing this. I have verified that the patch indeed fixes the issue for me.

-- 
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
Previous: Clemens Buchacher
Message 9 of 9 in “Segfault in "git remote show <remote-name>"”
  1. Erik Faye-LundMay 25, 2009
  2. Clemens BuchacherMay 25, 2009
  3. Jay SoffianMay 26, 2009
  4. 1/2 fix segfault showing an empty remoteClemens Buchacher, May 27, 2009
  5. 2/2 match_refs: search ref list tail internallyClemens Buchacher, May 27, 2009
  6. Junio C HamanoMay 28, 2009
  7. Clemens BuchacherMay 28, 2009
  8. match_refs: search ref list tail internallyClemens Buchacher, May 31, 2009
  9. Erik Faye-LundMay 26, 2009

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.