git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: git@vger.kernel.org
Subject: Re: contrib/credential/netrc/git-credential-netrc: Use of uninitialized value in string
Date: Tue, 3 Sep 2013 13:35:44 -0400	[thread overview]
Message-ID: <20130903173543.GC1050@sigill.intra.peff.net> (raw)
In-Reply-To: <87k3iyhqu5.fsf@lifelogs.com>

On Tue, Sep 03, 2013 at 11:23:14AM -0400, Ted Zlatanov wrote:

> Yes, you're right.  Something like the following (untested) could work
> and does the wildcards, which I will make into a proper patch and test
> if it looks OK to you.
> 
> Ted
> 
> diff --git a/contrib/credential/netrc/git-credential-netrc b/contrib/credential/netrc/git-credential-netrc
> index 6c51c43..13e537b 100755
> --- a/contrib/credential/netrc/git-credential-netrc
> +++ b/contrib/credential/netrc/git-credential-netrc
> @@ -369,7 +369,10 @@ sub find_netrc_entry {
>         {
>                 my $entry_text = join ', ', map { "$_=$entry->{$_}" } keys %$entry;
>                 foreach my $check (sort keys %$query) {
> -                       if (defined $query->{$check}) {
> +                       if (!defined $entry->{$check}) {
> +                              log_debug("OK: entry has no $check token, so any value satisfies check $check");
> +                       }
> +                       elsif (defined $query->{$check}) {
>                                 log_debug("compare %s [%s] to [%s] (entry: %s)",
>                                           $check,
>                                           $entry->{$check},

Yeah, that makes sense to me (and is basically what the credential-cache
and credential-store helpers do internally). Thanks for working on this.

-Peff

  reply	other threads:[~2013-09-03 17:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-24 14:55 contrib/credential/netrc/git-credential-netrc: Use of uninitialized value in string Antoine Pelisse
2013-08-27  3:56 ` Junio C Hamano
2013-08-27 20:05   ` Jeff King
2013-09-03 15:23     ` Ted Zlatanov
2013-09-03 17:35       ` Jeff King [this message]
2013-10-08 14:34         ` Ted Zlatanov

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=20130903173543.GC1050@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=tzz@lifelogs.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 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).