git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH?] Fix 'git show' on signed tag of signed tag of commit
Date: Tue, 01 Jul 2008 16:55:13 -0700	[thread overview]
Message-ID: <7vbq1hkvmm.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1214905624-29517-1-git-send-email-trast@student.ethz.ch

Thomas Rast <trast@student.ethz.ch> writes:

> The cmd_show loop resolves tags by showing them, then pointing the
> object to the 'tagged' member.  However, this object is not fully
> initialized; it only contains the SHA1.  (This resulted in a segfault
> if there were two levels of tags.)  We apply parse_object to get a
> full object.
>
> Noticed by Kalle Olavi Niemitalo on IRC.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>
> I'm not 100% sure this is the right fix; I just had a quick stab at
> the code, made a fix and tested it.  It probably leaks memory too, not
> sure if this is a problem.

The code looks good.  It should not have been accessing the object without
making sure it has been parsed.

And it's not a leak.  Once you instantiate "struct object" derived class,
we hold onto it (at least to its skeleton).

Thanks.

      parent reply	other threads:[~2008-07-01 23:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  9:47 [PATCH?] Fix 'git show' on signed tag of signed tag of commit Thomas Rast
2008-07-01 16:39 ` Johannes Schindelin
2008-07-01 23:55 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vbq1hkvmm.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).