xdl_merge(): fix a segmentation fault when refining conflicts
commit5d6b151fdd0a9e41ba68b444760616da1a008433
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Thu, 28 Dec 2006 16:13:33 +0000 (28 17:13 +0100)
committerJunio C Hamano <junkio@cox.net>
Thu, 28 Dec 2006 21:59:39 +0000 (28 13:59 -0800)
tree6e463b88e1adb37eb8248ce0ca179929a2ba7aa5
parent4a4d94b29b4546e15e6f25f8739663562d4f64a5
xdl_merge(): fix a segmentation fault when refining conflicts

The function xdl_refine_conflicts() tries to break down huge
conflicts by doing a diff on the conflicting regions. However,
this does not make sense when one side is empty.

Worse, when one side is not only empty, but after EOF, the code
accessed unmapped memory.

Noticed by Luben Tuikov, Shawn Pearce and Alexandre Julliard, the
latter providing a test case.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
t/t6023-merge-file.sh
xdiff/xmerge.c