Add one more safety guard for a potential crash

Resolves: RHEL-76958
This commit is contained in:
Jan Grulich 2025-02-05 18:58:41 +01:00
parent 43a23a0cde
commit ef9741c92b

View File

@ -10,7 +10,7 @@ Date: Wed Feb 5 12:29:43 2025 -0500
be passed along with the initial requests.
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 26ec176f..a00fe7fa 100644
index 26ec176f..3621dd3b 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -1225,12 +1225,10 @@ flatpak_remote_state_new_image_source (FlatpakRemoteState *self,
@ -37,6 +37,16 @@ index 26ec176f..a00fe7fa 100644
flatpak_progress_start_oci_pull (progress);
g_info ("Mirroring OCI image %s", flatpak_image_source_get_digest (image_source));
@@ -6514,6 +6515,9 @@ flatpak_dir_pull_oci (FlatpakDir *self,
else
image_source = flatpak_remote_state_fetch_image_source (state, self, ref, opt_rev, token, cancellable, error);
+ if (!image_source)
+ return FALSE;
+
oci_digest = flatpak_image_source_get_digest (image_source);
/* Short circuit if we've already got this commit */
diff --git a/common/flatpak-image-source-private.h b/common/flatpak-image-source-private.h
index 597a8174..5f9604d8 100644
--- a/common/flatpak-image-source-private.h