Re: [PATCH] make config --add behave correctly for empty and NULL values

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

 



Tanay Abhra <tanayabh@xxxxxxxxx> writes:

> Currently if we have a config file like,
> [foo]
>         baz
>         bar =
>
> and we try something like, "git config --add foo.baz roll", Git will
> segfault. Moreover, for "git config --add foo.bar roll", it will
> overwrite the original value instead of appending after the existing
> empty value.
>
> The problem lies with the regexp used for simulating --add in
> `git_config_set_multivar_in_file()`, "^$", which in ideal case should
> not match with any string but is true for empty strings. Instead use a
> regexp like "a^" which can not be true for any string, empty or not.
>
> For removing the segfault add a check for NULL values in `matches()` in
> config.c.

I would have prefered two separate patches (or even better, 3, the first
one being "demonstrate failure of ..." with test_expect_failure) for
each issues.

But the fixes are straightforward, and the test actually test what it
has to test, so I think we can keep the patch as-is.

Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]