Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rs/fix-alt-odb-path-comparison'
author
Junio C Hamano
<gitster@pobox.com>
Thu, 10 Jul 2014 18:27:52 +0000
(11:27 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 10 Jul 2014 18:27:52 +0000
(11:27 -0700)
* rs/fix-alt-odb-path-comparison:
sha1_file: avoid overrunning alternate object base string
sha1_file.c
patch
|
blob
|
history
raw
(from parent 1:
e7cdec6
)
diff --git
a/sha1_file.c
b/sha1_file.c
index 34d527f6708fe242f75b7fa0fa98e36a5c96a3be..a38854ce553c1e59294d5542a37a5404ccd66dc5 100644
(file)
--- 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;
}