From 618c38245f16f09ab8d72d51225b905fde80b8db Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Sep 2019 16:02:25 +0200 Subject: [PATCH] OCI: Don't crash on mirroring an OCI repo without annotations If we're using labels the annotations hashtable may be NULL, which was causing a crash. Just do an early check. Closes: #2978 Approved by: alexlarsson --- common/flatpak-json-oci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/flatpak-json-oci.c b/common/flatpak-json-oci.c index feef1eaf8..1a90df000 100644 --- a/common/flatpak-json-oci.c +++ b/common/flatpak-json-oci.c @@ -744,6 +744,9 @@ flatpak_oci_export_annotations (GHashTable *source, }; int i; + if (source == NULL) + return; + for (i = 0; i < G_N_ELEMENTS (keys); i++) { const char *key = keys[i];