avoid segfault on submodule.*.path set to an empty "true"
commit4b05440283350ec3b01afabe847d9ce5cf4cbdb7
authorJharrod LaFon <jlafon@eyesopen.com>
Mon, 19 Aug 2013 16:26:56 +0000 (19 09:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2013 20:47:56 +0000 (19 13:47 -0700)
treed07d7b4e2fcbfa3d9cb18df7e5110bcfbfc50ff4
parentf59bebb78edb26e4f66c2754bc4d168c5d4ebb4a
avoid segfault on submodule.*.path set to an empty "true"

Git fails due to a segmentation fault if a submodule path is empty.
Here is an example .gitmodules that will cause a segmentation fault:

    [submodule "foo-module"]
      path
      url = http://host/repo.git
    $ git status
    Segmentation fault (core dumped)

This is because the parsing of "submodule.*.path" is not prepared to
see a value-less "true" and assumes that the value is always
non-NULL (parsing of "ignore" has the same problem).

Fix it by checking the NULL-ness of value and complain with
config_error_nonbool().

Signed-off-by: Jharrod LaFon <jlafon@eyesopen.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c
t/t7400-submodule-basic.sh