git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Ted ZlatanovNext: Ted Zlatanov
Message 5 of 6 in “contrib/credential/netrc/git-credential-netrc: Use of uninitialized value in string”
  1. Antoine PelisseAug 24, 2013
  2. Junio C HamanoAug 27, 2013
  3. Jeff KingAug 27, 2013
  4. Ted ZlatanovSep 3, 2013
  5. Jeff KingSep 3, 2013
  6. Ted ZlatanovOct 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.