Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'hv/link-alt-odb-entry'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 30 Jul 2012 19:55:01 +0000
(12:55 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 30 Jul 2012 19:55:01 +0000
(12:55 -0700)
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
sha1_file.c
patch
|
blob
|
history
raw
(from parent 1:
dff9d65
)
diff --git
a/sha1_file.c
b/sha1_file.c
index 4ccaf7ac197c28400eddd496abcfc725528ca32b..af5cfbde63aed41d95ac7318d064d3012832d2c5 100644
(file)
--- 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;
}