From 896c0535afe2f00683f7d4e8171fad7ec156f16f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 14 Dec 2007 20:34:56 -0800 Subject: [PATCH] remote: Fix bogus make_branch() call in configuration reader. The configuration reader to enumerate branches that have configuration data were not careful enough and failed to skip "branch." entries (e.g. branch.autosetupmerge). This resulted in bogus attempt to allocate huge memory. Noticed by David Miller. Signed-off-by: Junio C Hamano --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.c b/remote.c index 3fb0f99b2..0e006804e 100644 --- a/remote.c +++ b/remote.c @@ -220,11 +220,11 @@ static int handle_config(const char *key, const char *value) if (!prefixcmp(key, "branch.")) { name = key + 7; subkey = strrchr(name, '.'); - branch = make_branch(name, subkey - name); if (!subkey) return 0; if (!value) return 0; + branch = make_branch(name, subkey - name); if (!strcmp(subkey, ".remote")) { branch->remote_name = xstrdup(value); if (branch == current_branch) -- 2.30.2