Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
remote: Fix bogus make_branch() call in configuration reader.
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>
remote.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1eb1e9e
)
diff --git
a/remote.c
b/remote.c
index 3fb0f99b29e7ffd927abf166cfa004c1937aaf60..0e006804ef3cc190fa286c85e2de034a33791886 100644
(file)
--- 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, '.');
if (!prefixcmp(key, "branch.")) {
name = key + 7;
subkey = strrchr(name, '.');
- branch = make_branch(name, subkey - name);
if (!subkey)
return 0;
if (!value)
return 0;
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)
if (!strcmp(subkey, ".remote")) {
branch->remote_name = xstrdup(value);
if (branch == current_branch)