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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 09, 2008 at 01:07:53PM -0800, Junio C Hamano wrote:
> Martin Koegler <mkoegler@xxxxxxxxxxxxxxxxx> writes:
> 
> > @@ -416,7 +416,7 @@ int git_default_config(const char *var, const char *value)
> >  		return 0;
> >  	}
> >  
> > -	if (!strcmp(var, "user.name")) {
> > +	if (value && !strcmp(var, "user.name")) {
> >  		strlcpy(git_default_name, value, sizeof(git_default_name));
> >  		return 0;
> >  	}
> 
> This is wrong, isn't it?  When somebody says
> 
> 	[user]
>         	name
> 
> we should not silently ignore it, but instead say "user.name is
> not a bool!" and error out.
> 
> The same comment applies to all other
> 
> 	if (value && !strcmp(var, "<varname>"))
> 
> conversions.

For all in config.c, yes.

For setup.c, I would say no. The code is called, when trying to find a
git repository.

I have seen, that a similar patch for the config.c stuff has been
posted. I will wait some days to see, what happens with it.

mfg Martin Kögler

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux