diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:17:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:17:08 -0700 |
commit | 5a3db94539acbf66b9fcf466b5ea7fd53295dc89 (patch) | |
tree | a9ce37821d811e0b4c718ad87aa2457d5dfc97c4 /sha1_file.c | |
parent | 5c18fde0d96cfcbc321caad8f809028b0c63aaeb (diff) | |
parent | 80b47854ca84abec991f6fff42dbeb6626588b87 (diff) | |
download | git-5a3db94539acbf66b9fcf466b5ea7fd53295dc89.tar.gz |
Merge branch 'rs/fix-alt-odb-path-comparison' into maint
Code to avoid adding the same alternate object store twice was
subtly broken for a long time, but nobody seems to have noticed.
* rs/fix-alt-odb-path-comparison:
sha1_file: avoid overrunning alternate object base string
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c index 34d527f670..a38854ce55 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -315,7 +315,8 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int * thing twice, or object directory itself. */ for (alt = alt_odb_list; alt; alt = alt->next) { - if (!memcmp(ent->base, alt->base, pfxlen)) { + if (pfxlen == alt->name - alt->base - 1 && + !memcmp(ent->base, alt->base, pfxlen)) { free(ent); return -1; } |