All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean <seanlkml@sympatico.ca>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Avoid segfault when passed malformed refspec
Date: Fri, 1 Feb 2008 20:26:02 -0500	[thread overview]
Message-ID: <BAYC1-PASMTP11F54ED60A103C52F2406AAE310@CEZ.ICE> (raw)
In-Reply-To: <7vzluk6ugn.fsf@gitster.siamese.dyndns.org>

On Fri, 01 Feb 2008 17:03:04 -0800
Junio C Hamano <gitster@pobox.com> wrote:

> Sean <seanlkml@sympatico.ca> writes:
> >
> > +		if (!rs[i].dst)
> > +			rs[i].dst = xstrdup("");
>
> I haven't followed the codepath carefully before responding, it
> feels like sweeping the breakage under the carpet, without
> fixing the real issue.
> 
> If the problem is a badly formatted input, shouldn't the code
> die loudly with diagnostic message, instead of pretending as if
> the user said something different (and sensible), especially
> without telling the user that that is what the code is doing?
> 

Hey Junio,

You're probably right.  It seemed like a reasonable fix at the time
without having to understand the code too deeply.  With the above
patch, the code does complain to the user:

  $ git-fetch ../repo refs/heads/* :refs/heads/* 
  fatal: * refusing to create funny ref 'floop' locally

But surely a better error could be shown if fetch is made to
squawk whenever a destination ref is omitted.   I just wasn't
confident enough in the code, or in knowing what refspec rules
are universally applicable.

Sean

      reply	other threads:[~2008-02-02  1:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02  0:00 [PATCH] Avoid segfault when passed malformed refspec Sean
2008-02-02  1:03 ` Junio C Hamano
2008-02-02  1:26   ` Sean [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=BAYC1-PASMTP11F54ED60A103C52F2406AAE310@CEZ.ICE \
    --to=seanlkml@sympatico.ca \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.