Re: [PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Junio C Hamano
Elijah Newren writes: > unpack-trees.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/unpack-trees.c b/unpack-trees.c > index e73745051e..08f6cab82e 100644 > --- a/unpack-trees.c > +++ b/unpack-trees.c > @@ -1284,9 +1284,20 @@ int unpack_trees(unsigne

Re: [PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Junio C Hamano
Elijah Newren writes: > Marked as PATCH v2, though I marked the previous one as "RFC PATCH v10 > 32.5/36" because I thought I was going to put it in my series. But it is > an independent fix that my series needs. Thanks. Let's take this before the remainder of the series ;-)

[PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Elijah Newren
Currently, all callers of unpack_trees() set o->src_index == o->dst_index. The code in unpack_trees() does not correctly handle them being different. There are two separate issues: First, there is the possibility of memory corruption. Since unpack_trees() creates a temporary index in o->result an