summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2018-07-11 12:32:18 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-11 18:22:32 +0000
commit11c9d124d7d0b80a076046f69495d5b7d3ca5237 (patch)
treeadfb175dd4e5a8807bf18a790d1b327ec1bf27d2
parent8aaacaac503ab7316e903e056149a62c6bafafe0 (diff)
downloadflatpak-11c9d124d7d0b80a076046f69495d5b7d3ca5237.tar.gz
dir: Propagate errors from copying summary{.sig}
This commit ensures that flatpak_remote_state_save_summary() initializes the passed GError pointer when returning FALSE. I found this when looking into https://github.com/flatpak/flatpak/issues/1255 because at the time of that bug report flatpak_dir_update_appstream() had this g_file_replace_contents() code in it, which would have caused a seg fault in update_appstream() after an unsuccessful call to flatpak_dir_update_appstream(). Fixes https://github.com/flatpak/flatpak/issues/1255 Closes: #1893 Approved by: alexlarsson
-rw-r--r--common/flatpak-dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 092ba65a..d0bd3fb1 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -415,7 +415,7 @@ flatpak_remote_state_save_summary (FlatpakRemoteState *self,
if (!g_file_replace_contents (summary_file,
g_bytes_get_data (summary_bytes, NULL),
g_bytes_get_size (summary_bytes),
- NULL, FALSE, 0, NULL, cancellable, NULL))
+ NULL, FALSE, 0, NULL, cancellable, error))
return FALSE;
if (self->summary_sig_bytes != NULL)
@@ -424,7 +424,7 @@ flatpak_remote_state_save_summary (FlatpakRemoteState *self,
if (!g_file_replace_contents (summary_sig_file,
g_bytes_get_data (self->summary_sig_bytes, NULL),
g_bytes_get_size (self->summary_sig_bytes),
- NULL, FALSE, 0, NULL, cancellable, NULL))
+ NULL, FALSE, 0, NULL, cancellable, error))
return FALSE;
}