diff options
author | Dan Nicholson <nicholson@endlessm.com> | 2016-07-30 10:14:17 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-07-31 00:01:52 +0000 |
commit | 512090785e039e560f5e0df9b1e1db004298eeb6 (patch) | |
tree | 1a027127f9d0d181cfa63d27b5b021179c7c26e4 /src/libostree/ostree-repo-static-delta-core.c | |
parent | edecae06ab65f139cddbb701cb37b672715bb176 (diff) | |
download | ostree-512090785e039e560f5e0df9b1e1db004298eeb6.tar.gz |
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
Diffstat (limited to 'src/libostree/ostree-repo-static-delta-core.c')
-rw-r--r-- | src/libostree/ostree-repo-static-delta-core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c index 68c45055..46fa5f86 100644 --- a/src/libostree/ostree-repo-static-delta-core.c +++ b/src/libostree/ostree-repo-static-delta-core.c @@ -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, |