From: Junio C Hamano Date: Sat, 15 Dec 2007 04:34:56 +0000 (-0800) Subject: remote: Fix bogus make_branch() call in configuration reader. X-Git-Tag: v1.5.4-rc1~64 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=896c0535afe2f00683f7d4e8171fad7ec156f16f;p=git.git 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 --- 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)