From fd197300b9727a7da8d4d9e611ea6827fe3735b2 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 3 Jun 2020 14:34:26 +0200 Subject: [PATCH] oci: Fix potential crash Call flatpak_remote_state_ensure_summary() before dereferencing RemoteState->summary to return an error instead of crashing if downloading the summary failed. --- common/flatpak-dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 241a3786..ca59ba1b 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -716,6 +716,9 @@ flatpak_remote_state_new_oci_registry (FlatpakRemoteState *self, g_autofree char *registry_uri = NULL; g_autoptr(FlatpakOciRegistry) registry = NULL; + if (!flatpak_remote_state_ensure_summary (self, error)) + return NULL; + registry_uri = lookup_oci_registry_uri_from_summary (self->summary, error); if (registry_uri == NULL) return NULL;