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.
This commit is contained in:
Alexander Larsson
2020-06-03 14:34:26 +02:00
committed by Alexander Larsson
parent 47daa077c2
commit fd197300b9

View File

@@ -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;