diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-30 12:55:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-30 12:55:01 -0700 |
commit | fbea95ce10553a850cf7561dc92a7487669d7d3c (patch) | |
tree | 0bc01c5a271c7845ecc7a0c26709e58091a21821 | |
parent | Add explanatory comment for transport-helpers refs mapping. (diff) | |
parent | link_alt_odb_entry: fix read over array bounds reported by valgrind (diff) | |
download | tgif-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.c | 2 |
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; } |