From 60e5529ba0143e6bf4e204fd00f7989d0f3c57c5 Mon Sep 17 00:00:00 2001 From: John Hiesey Date: Thu, 1 Oct 2015 17:26:47 -0700 Subject: [PATCH] static-delta: Set error on bsdiff failure bsdiff can fail when generating static deltas, particularly if not enough memory is available. Set error properly when this happens. https://bugzilla.gnome.org/show_bug.cgi?id=756260 --- src/libostree/ostree-repo-static-delta-compilation.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 063c4088..c63942f0 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -829,8 +829,10 @@ process_one_bsdiff (OstreeRepo *repo, op.cancellable = cancellable; op.error = error; stream.opaque = &op; - if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0) + if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0) { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "bsdiff generation failed"); goto out; + } payload = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (out)); payload_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (out));