summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1eb1e9e)
raw | patch | inline | side by side (parent: 1eb1e9e)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Dec 2007 04:34:56 +0000 (20:34 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Dec 2007 04:34:56 +0000 (20:34 -0800) |
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>
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>
remote.c | patch | blob | history |
diff --git a/remote.c b/remote.c
index 3fb0f99b29e7ffd927abf166cfa004c1937aaf60..0e006804ef3cc190fa286c85e2de034a33791886 100644 (file)
--- a/remote.c
+++ b/remote.c
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)