diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-04 12:36:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-04 12:36:51 -0700 |
commit | 5fb0e0868c25d4be66ead46992c393ed5f91c2d1 (patch) | |
tree | 2b382daeba5b2deb656bbb4fd4483f08e5d38206 /submodule.c | |
parent | baa8d42f0508f0854a83b068c7f6ca227b143d38 (diff) | |
parent | 4b05440283350ec3b01afabe847d9ce5cf4cbdb7 (diff) | |
download | git-5fb0e0868c25d4be66ead46992c393ed5f91c2d1.tar.gz |
Merge branch 'jl/some-submodule-config-are-not-boolean'
* jl/some-submodule-config-are-not-boolean:
avoid segfault on submodule.*.path set to an empty "true"
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c index 3f0a3f9419..c0f93c208c 100644 --- a/submodule.c +++ b/submodule.c @@ -134,6 +134,9 @@ int parse_submodule_config_option(const char *var, const char *value) return 0; if (!strcmp(key, "path")) { + if (!value) + return config_error_nonbool(var); + config = unsorted_string_list_lookup(&config_name_for_path, value); if (config) free(config->util); @@ -151,6 +154,9 @@ int parse_submodule_config_option(const char *var, const char *value) } else if (!strcmp(key, "ignore")) { char *name_cstr; + if (!value) + return config_error_nonbool(var); + if (strcmp(value, "untracked") && strcmp(value, "dirty") && strcmp(value, "all") && strcmp(value, "none")) { warning("Invalid parameter \"%s\" for config option \"submodule.%s.ignore\"", value, var); |