summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-30 19:55:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-30 19:55:01 (GMT)
commitfbea95ce10553a850cf7561dc92a7487669d7d3c (patch)
tree0bc01c5a271c7845ecc7a0c26709e58091a21821 /sha1_file.c
parentdff9d65dc61af8a00a6eef153ebc59b76de9c412 (diff)
parentcb2912c324477f0d92618ac258c43b2692e870c4 (diff)
downloadgit-fbea95ce10553a850cf7561dc92a7487669d7d3c.zip
git-fbea95ce10553a850cf7561dc92a7487669d7d3c.tar.gz
git-fbea95ce10553a850cf7561dc92a7487669d7d3c.tar.bz2
Merge branch 'hv/link-alt-odb-entry'
The code to avoid mistaken attempt to add the object directory itself as its own alternate could read beyond end of a string while comparison. * hv/link-alt-odb-entry: link_alt_odb_entry: fix read over array bounds reported by valgrind
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4ccaf7a..af5cfbd 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -298,7 +298,7 @@ static int link_alt_odb_entry(const char * entry, int len, const char * relative
return -1;
}
}
- if (!memcmp(ent->base, objdir, pfxlen)) {
+ if (!strcmp(ent->base, objdir)) {
free(ent);
return -1;
}