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

Re: [PATCH] setup.c: guard config parser from value=NULL

From
Michele Ballabio <barra_cuda@katamail.com>
Date
Feb 8, 2008, 16:34 UTC
Message-ID
<200802081734.24967.barra_cuda@katamail.com>
In-Reply-To
<20080208142702.GY25954@genesis.frugalware.org>
On Friday 08 February 2008, Miklos Vajna wrote:
Show 7 quoted lines
> diff --git a/setup.c b/setup.c
> index adede16..361825f 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -346,13 +346,13 @@ int git_config_perm(const char *var, const char *value)
>  {
>  	if (value) {
            ^^^^^
value is already checked here. No need to check further.
Show 15 quoted lines
>  		int i;
> -		if (!strcmp(value, "umask"))
> +		if (value && !strcmp(value, "umask"))
>  			return PERM_UMASK;
> -		if (!strcmp(value, "group"))
> +		if (value && !strcmp(value, "group"))
>  			return PERM_GROUP;
> -		if (!strcmp(value, "all") ||
> +		if (value && (!strcmp(value, "all") ||
>  		    !strcmp(value, "world") ||
> -		    !strcmp(value, "everybody"))
> +		    !strcmp(value, "everybody")))
>  			return PERM_EVERYBODY;
>  		i = atoi(value);
>  		if (i > 1)
Previous: Miklos VajnaNext: Miklos Vajna
Message 7 of 15 in “[Janitors] value could be NULL in config parser”
  1. Junio C HamanoFeb 8, 2008
  2. archive-tar.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  3. builtin-gc.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  4. remote.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  5. Michele BallabioFeb 8, 2008
  6. setup.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  7. Michele BallabioFeb 8, 2008
  8. Miklos VajnaFeb 8, 2008
  9. Govind SalinasFeb 8, 2008
  10. Govind SalinasFeb 9, 2008
  11. Christian CouderFeb 9, 2008
  12. Junio C HamanoFeb 9, 2008
  13. Christian CouderFeb 9, 2008
  14. Christian CouderFeb 9, 2008
  15. Govind SalinasFeb 9, 2008

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.