git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Goddard Rosa" <andre.goddard@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Daniel Barkalow" <barkalow@iabervon.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: fetch_refs_via_pack() discards status?
Date: Wed, 5 Dec 2007 22:38:35 -0200	[thread overview]
Message-ID: <b8bf37780712051638x5a2ea5d4i61631f31af65cb54@mail.gmail.com> (raw)
In-Reply-To: <7vwsrsonqm.fsf@gitster.siamese.dyndns.org>

On Dec 5, 2007 7:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > On Tue, 4 Dec 2007, Junio C Hamano wrote:
> >
> >> The code calls fetch_pack() to get the list of refs it fetched, and
> >> discards refs and always returns 0 to signal success.
> >>
> >> But builtin-fetch-pack.c::fetch_pack() has error cases.  The function
> >> returns NULL if error is detected (shallow-support side seems to choose
> >> to die but I suspect that is easily fixable to error out as well).
> >>
> >> Shouldn't fetch_refs_via_pack() propagate that error to the caller?
> >
> > I think that's right. I think I got as far as having the error status from
> > fetch_pack() actually returned correctly, and then failed to look at it.
> > I'd personally avoid testing a pointer to freed memory, but that's
> > obviously not actually wrong.
> >
> >       -Daniel
>
> Hmph, is that an Ack that the patchlet is actually a bugfix?
>

Hi, Mr. Junio!

     My 2 cents: I think he means that we should not test a freed pointer:

       free_refs(refs);
       free(dest);                     <===
-       return 0;
+       return (refs ? 0 : -1);     <===

Best regards,
-- 
[]s,
André Goddard

  reply	other threads:[~2007-12-06  0:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22  0:59 [PATCH] Fix segmentation fault when user doesn't have access permission to the repository André Goddard Rosa
2007-11-22 16:09 ` Alex Riesen
2007-11-22 22:27   ` André Goddard Rosa
2007-11-25 21:39     ` [Resend PATCH] " André Goddard Rosa
2007-11-30 21:22       ` Junio C Hamano
2007-12-05  7:01         ` fetch_refs_via_pack() discards status? Junio C Hamano
2007-12-05 19:16           ` Daniel Barkalow
2007-12-05 21:06             ` Junio C Hamano
2007-12-06  0:38               ` André Goddard Rosa [this message]
2007-12-06 14:09               ` Daniel Barkalow

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=b8bf37780712051638x5a2ea5d4i61631f31af65cb54@mail.gmail.com \
    --to=andre.goddard@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /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).