Browse files

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
  • Loading branch information...
2 parents dff9d65 + cb2912c commit fbea95ce10553a850cf7561dc92a7487669d7d3c @gitster gitster committed Jul 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 sha1_file.c
View
2 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;
}

0 comments on commit fbea95c

Please sign in to comment.