diff options
| author | Alexander Larsson <alexl@redhat.com> | 2020-06-03 14:34:26 +0200 |
|---|---|---|
| committer | Alexander Larsson <alexander.larsson@gmail.com> | 2020-06-05 09:35:30 +0200 |
| commit | fd197300b9727a7da8d4d9e611ea6827fe3735b2 (patch) | |
| tree | 7f1bf83863106fb5775859ee7c4108967e5fc546 | |
| parent | 47daa077c2339f1313cc089fa8e6781c4d1c50fe (diff) | |
| download | flatpak-fd197300b9727a7da8d4d9e611ea6827fe3735b2.tar.gz | |
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.
| -rw-r--r-- | common/flatpak-dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |
