# HG changeset patch # User Erling Ellingsen # Date 1172006416 -3600 # Node ID 1ca664c964e0003ce99f6550aeeeed4ccf76851d # Parent 178007785be82a428abb04815b44ba7d0926abcf don't return uninitialized memory from bdiff.blocks() bdiff.blocks() returns a dummy match at the end of both files; the length of that chunk is never set, so it will sometimes contain random heap garbage. There are apparently workarounds for this elsewhere: # bdiff sometimes gives huge matches past eof, this check eats them, diff -r 178007785be8 -r 1ca664c964e0 mercurial/bdiff.c --- a/mercurial/bdiff.c Mon Feb 19 10:08:59 2007 +0100 +++ b/mercurial/bdiff.c Tue Feb 20 22:20:16 2007 +0100 @@ -251,8 +251,8 @@ if (pos && l.base && t) { /* generate the matching block list */ recurse(a, b, pos, 0, an, 0, bn, &l); - l.head->a1 = an; - l.head->b1 = bn; + l.head->a1 = l.head->a2 = an; + l.head->b1 = l.head->b2 = bn; l.head++; }