diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-14 20:34:56 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-14 20:34:56 -0800 |
commit | 896c0535afe2f00683f7d4e8171fad7ec156f16f (patch) | |
tree | ea5c7c05370fe04b1ecd9917290ed55eb082ac83 /remote.c | |
parent | 1eb1e9eea480059d4fba171e74a4375b8191e3f3 (diff) | |
download | git-896c0535afe2f00683f7d4e8171fad7ec156f16f.tar.gz |
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.<variable>"
entries (e.g. branch.autosetupmerge). This resulted in bogus attempt to
allocate huge memory.
Noticed by David Miller.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |