git/xdiff
Michael Haggerty a8fd78cc53 xdl_change_compact(): fix compaction heuristic to adjust ixo
The code branch used for the compaction heuristic forgot to keep ixo in
sync while the group was shifted. This is certainly wrong, as it causes
the two counters to get out of sync.

I *think* that this bug could also have caused the function to read past
the end of the rchgo array, though I haven't done the work to prove it
for sure. Here is my reasoning:

If ixo is not decremented correctly during one iteration of the outer
while loop, then it will loose sync with the ix counter. In particular,
ixo will be too large.

Suppose that the next iterations of the outer while loop (i.e.,
processing the next block of add/delete lines) don't have any sliders.
Then the ixo counter would be incremented by the number of non-changed
lines in xdf, which is the same as the number of non-changed lines in
xdfo that *should have* followed the group that experienced the
malfunction. But since ixo was too large at the end of that iteration,
it will be incremented past the end of the xdfo->rchg array, and will
try to read that memory illegally.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-23 13:51:47 -07:00
..
xdiff.h Merge branch 'jk/diff-compact-heuristic' 2016-05-06 14:45:46 -07:00
xdiffi.c xdl_change_compact(): fix compaction heuristic to adjust ixo 2016-08-23 13:51:47 -07:00
xdiffi.h diff: add --ignore-blank-lines option 2013-06-19 15:17:45 -07:00
xemit.c xdiff: fix merging of appended hunk with -W 2016-06-09 15:27:26 -07:00
xemit.h diff: add --ignore-blank-lines option 2013-06-19 15:17:45 -07:00
xhistogram.c Correct common spelling mistakes in comments and tests 2013-04-12 13:38:40 -07:00
xinclude.h War on whitespace 2007-06-07 00:04:01 -07:00
xmacros.h xdiff: cast arguments for ctype functions to unsigned char 2010-10-06 10:46:45 -07:00
xmerge.c Merge branch 'ps/plug-xdl-merge-leak' 2016-02-26 13:37:22 -08:00
xpatience.c xdiff: PATIENCE/HISTOGRAM are not independent option bits 2012-02-19 15:36:55 -08:00
xprepare.c xdiff/xprepare: fix a memory leak 2016-03-04 15:51:08 -08:00
xprepare.h War on whitespace 2007-06-07 00:04:01 -07:00
xtypes.h War on whitespace 2007-06-07 00:04:01 -07:00
xutils.c diff: add --ignore-blank-lines option 2013-06-19 15:17:45 -07:00
xutils.h diff: add --ignore-blank-lines option 2013-06-19 15:17:45 -07:00