deltas: Allow processing of empty delta parts
If a static delta is generated between 2 commits with the same content, then the delta will contain 1 part with no checksums. While useless, this is a valid delta that shouldn't raise an assertion. If the delta part has no checksums, then there are no objects to recreate and the processing can be skipped. Closes: #420 Approved by: cgwalters
This commit is contained in:
1 parent
edecae06ab
commit
512090785e
2 files changed
+8
-3
No files matched your search
@@ -42,8 +42,7 @@ _ostree_static_delta_parse_checksum_array (GVariant *array,
|
||||
|
||||
n_checksums = n / OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN;
|
||||
|
||||
if (G_UNLIKELY(n == 0 ||
|
||||
n > (G_MAXUINT32/OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) ||
|
||||
if (G_UNLIKELY(n > (G_MAXUINT32/OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) ||
|
||||
(n_checksums * OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) != n))
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
|
||||
Reference in new issue
Block a user