Re: contrib/credential/netrc/git-credential-netrc: Use of uninitialized value in string
- From
Jeff King <peff@peff.net>
- Date
- Sep 3, 2013, 17:35 UTC
- Message-ID
- <20130903173543.GC1050@sigill.intra.peff.net>
- In-Reply-To
- <87k3iyhqu5.fsf@lifelogs.com>
On Tue, Sep 03, 2013 at 11:23:14AM -0400, Ted Zlatanov wrote:
Show 22 quoted lines
> 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