summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2021-05-11 15:07:48 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2021-05-11 15:12:15 +0100
commita65e97c38087de7f9b83f1bc2f27fd0869dff367 (patch)
treecdacff5112984c0655802a7f5e5c6aa018ef61ea
parent404d7c6941baf63d1b3ccbe9ee9d34f3ff12f35f (diff)
downloadflatpak-a65e97c38087de7f9b83f1bc2f27fd0869dff367.tar.gz
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 <pwithnall@endlessos.org>
-rw-r--r--common/flatpak-dir.c2
1 files changed, 1 insertions, 1 deletions
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);