Commit Briefs

f1dbec24f9 Stefan Sperling

fix a size_t multiplication overflow in diff_meyrs.c

Found on an OpenBSD armv7 machine running Got regression tests: test_status_shows_no_mods_after_complete_merge Segmentation fault (core dumped) The problematic multiplication is kd_len * kd_len in diff_algo_myers() with kd_len set to 65537. (gdb) p (int)(65537 * 65537) $64 = 131073 (gdb) p (int)(65537 + 65537) $65 = 131074 (gdb) p (unsigned int)(size_t)(-1) $68 = 4294967295 (gdb) p (4294967295 / kd_len) $71 = 65535 Detect such overflow and run the fallback diff algorithm instead.


60c6aae16f Stefan Sperling

set a minimum myers effort limit to avoid an early short-cut on small files

discussed with Neels


fe6d58fb52 Christian Weisgerber

add a missing include for uint8_t and switch from <inttypes.h> to <stdint.h>

ok millert stsp


7280e29c8e Neels Hofmeyr

remove a bunch of overly verbose debug




f579bf7733 Neels Hofmeyr

debug output fixes

- fix compilation error with DEBUG 1, after moving patience state out of diff_atom, and after renaming diff_data.d to diff_data.root. - add some missing newlines. - also debug "HIT" on a max-effort cut, like when finding a mid snake, which eases finding all the places where boxes get cut.


70fb5a4714 Neels Hofmeyr

diff_myers: fix some uninitialized warnings


984ca65b1b Neels Hofmeyr

myers_divide: fix "inifite" looping over same box


19fad31f2f Neels Hofmeyr

debug: diff_myers.c: #if DEBUG, not if (DEBUG)


359b29cbe1 Neels Hofmeyr

debug: fix "state size:" printing buf size


c254f08cfd Neels Hofmeyr

drop dangerous debug statement



2a1b94d029 Stefan Sperling

repair DEBUG build




e4464189bc Stefan Sperling

rename 'debug.h' to 'diff_debug.h'



ac2eeeffef Neels Hofmeyr

myers: error handling from diff_atoms_same()




3e6cba3a54 Stefan Sperling

replace enum diff_rc errors with plain errno values


0d27172a82 Neels Hofmeyr

KNF: use max 80 columns


61a7b57805 Neels Hofmeyr

KNF: function declaration return types on separate line