Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
pretty: allow %(trailers) options with explicit value
[gitweb.git]
/
tree-walk.c
diff --git
a/tree-walk.c
b/tree-walk.c
index ecd6e53b8541408add0de076b01932a1ffd631e9..77b37f36fa1bc8fae48231d35514b88d51902488 100644
(file)
--- a/
tree-walk.c
+++ b/
tree-walk.c
@@
-27,8
+27,9
@@
static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l
{
const char *path;
unsigned int mode, len;
+ const unsigned hashsz = the_hash_algo->rawsz;
- if (size <
23 || buf[size - 21
]) {
+ if (size <
hashsz + 3 || buf[size - (hashsz + 1)
]) {
strbuf_addstr(err, _("too-short tree object"));
return -1;
}