# 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 --git a/mercurial/bdiff.c b/mercurial/bdiff.c --- a/mercurial/bdiff.c +++ b/mercurial/bdiff.c @@ -251,8 +251,8 @@ static struct hunklist diff(struct line 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++; }