From: Junio C Hamano Date: Mon, 11 Feb 2008 19:00:10 +0000 (-0800) Subject: remote.c: guard config parser from value=NULL X-Git-Tag: v1.5.4.2~33 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d2370cc2960d3b0a090c57dfea99209c59b515f7;p=git.git remote.c: guard config parser from value=NULL branch.*.{remote,merge} expect a string value Signed-off-by: Junio C Hamano --- diff --git a/remote.c b/remote.c index 0e006804e..20abbc07a 100644 --- a/remote.c +++ b/remote.c @@ -222,15 +222,18 @@ static int handle_config(const char *key, const char *value) subkey = strrchr(name, '.'); if (!subkey) return 0; - if (!value) - return 0; branch = make_branch(name, subkey - name); if (!strcmp(subkey, ".remote")) { + if (!value) + return config_error_nonbool(key); branch->remote_name = xstrdup(value); if (branch == current_branch) default_remote_name = branch->remote_name; - } else if (!strcmp(subkey, ".merge")) + } else if (!strcmp(subkey, ".merge")) { + if (!value) + return config_error_nonbool(key); add_merge(branch, xstrdup(value)); + } return 0; } if (prefixcmp(key, "remote."))