Skip to content

Commit

Permalink
remote: Fix bogus make_branch() call in configuration reader.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 15, 2007
1 parent 1eb1e9e commit 896c053
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 896c053

Please sign in to comment.