projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b9f4b0
)
rollsum: Fix assertion for CRC matches
author
Colin Walters
<walters@verbum.org>
Tue, 25 Aug 2015 13:26:22 +0000
(09:26 -0400)
committer
Colin Walters
<walters@verbum.org>
Tue, 25 Aug 2015 13:26:22 +0000
(09:26 -0400)
It's possible for two blocks to have the same CRC but different
length. Rather than asserting, treat them as not matching.
src/libostree/ostree-rollsum.c
patch
|
blob
|
history
diff --git
a/src/libostree/ostree-rollsum.c
b/src/libostree/ostree-rollsum.c
index a200765499c675d5ba5a728031be00aa3c01c0f9..7e9190ce5a3a2fd1f925ae5d9d0286026cb89551 100644
(file)
--- a/
src/libostree/ostree-rollsum.c
+++ b/
src/libostree/ostree-rollsum.c
@@
-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.