aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-31 17:42:26 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-31 17:42:26 -0800
commitddebfd1f27110bbcd0e8da0417bc425509af219a (patch)
tree4d2fd8b58d9bc40674ee892fc7b024cc42b9e382
parent99ccabaffa201e867f2073947dcccae3947ec4f1 (diff)
parent6ac92294b30d7c8619cf15b531448f011dbdcdcc (diff)
downloadgit-ddebfd1f27110bbcd0e8da0417bc425509af219a.tar.gz
git-ddebfd1f27110bbcd0e8da0417bc425509af219a.tar.xz
Merge branch 'maint'
* maint: merge: fix out-of-bounds memory access
-rw-r--r--unpack-trees.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 16bc2ca9e..e547282ed 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -240,8 +240,11 @@ static struct cache_entry *create_ce_entry(const struct traverse_info *info, con
return ce;
}
-static int unpack_nondirectories(int n, unsigned long mask, unsigned long dirmask, struct cache_entry *src[5],
- const struct name_entry *names, const struct traverse_info *info)
+static int unpack_nondirectories(int n, unsigned long mask,
+ unsigned long dirmask,
+ struct cache_entry **src,
+ const struct name_entry *names,
+ const struct traverse_info *info)
{
int i;
struct unpack_trees_options *o = info->data;
@@ -291,7 +294,7 @@ static int unpack_nondirectories(int n, unsigned long mask, unsigned long dirmas
static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *names, struct traverse_info *info)
{
- struct cache_entry *src[5] = { NULL, };
+ struct cache_entry *src[MAX_UNPACK_TREES + 1] = { NULL, };
struct unpack_trees_options *o = info->data;
const struct name_entry *p = names;