rollsum: Fix assertion for CRC matches

It's possible for two blocks to have the same CRC but different
length.  Rather than asserting, treat them as not matching.
This commit is contained in:
Colin Walters 2015-08-25 09:26:22 -04:00
parent 9b9f4b04b4
commit b89326ac41
1 changed files with 4 additions and 1 deletions

View File

@ -162,7 +162,10 @@ _ostree_compute_rollsum_matches (GBytes *from,
g_variant_get (from_chunk, "(utt)", &fromcrc, &from_start, &from_offset);
g_assert (fromcrc == tocrc);
g_assert (to_offset == from_offset);
/* Same crc32 but different length, skip it. */
if (to_offset != from_offset)
continue;
/* Rsync uses a cryptographic checksum, but let's be
* very conservative here and just memcmp.