summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-07-30 12:55:01 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-30 12:55:01 -0700
commitfbea95ce10553a850cf7561dc92a7487669d7d3c (patch)
tree0bc01c5a271c7845ecc7a0c26709e58091a21821
parentAdd explanatory comment for transport-helpers refs mapping. (diff)
parentlink_alt_odb_entry: fix read over array bounds reported by valgrind (diff)
downloadtgif-fbea95ce10553a850cf7561dc92a7487669d7d3c.tar.xz
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
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4ccaf7ac19..af5cfbde63 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;
}