From a65e97c38087de7f9b83f1bc2f27fd0869dff367 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 11 May 2021 15:07:48 +0100 Subject: [PATCH] dir: Avoid a crash when looking up summary for a ref without an arch If looking up the summary for a ref without an arch (for example, `ostree-metadata`, which the Endless OS version of flatpak uses in some backwards-compatibility code), avoid passing `NULL` to `strcmp()` and hence crashing. Signed-off-by: Philip Withnall --- common/flatpak-dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index ec52291c..d4f5e5c5 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -595,7 +595,7 @@ get_summary_for_ref (FlatpakRemoteState *self, if (arch != NULL) summary = g_hash_table_lookup (self->subsummaries, arch); - if (summary == NULL) + if (summary == NULL && arch != NULL) { const char *non_compat_arch = flatpak_get_compat_arch_reverse (arch);