From 70ddf44b40f70a07d1fc9b2e071e4607bcd90fc0 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 13 Mar 2026 23:14:55 +0100 Subject: [PATCH] builtins-utils, dir: Be more strict about what is acceptable The 'arch' parameter of flatpak_dir_remote_fetch_indexed_summary() is used to construct the names of the caches, and can't be NULL. This function is used by flatpak_remote_state_ensure_subsummary(), which is used by ensure_remote_state_arch(). So, the parameter can't be NULL in those either. --- app/flatpak-builtins-utils.c | 2 ++ common/flatpak-dir.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/flatpak-builtins-utils.c b/app/flatpak-builtins-utils.c index 26ba98ce..d1d979c4 100644 --- a/app/flatpak-builtins-utils.c +++ b/app/flatpak-builtins-utils.c @@ -1413,6 +1413,8 @@ ensure_remote_state_arch (FlatpakDir *dir, { g_autoptr(GError) local_error = NULL; + g_return_val_if_fail (arch != NULL, FALSE); + if (only_sideloaded) return TRUE; diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index d8042182..248368d4 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -604,6 +604,8 @@ flatpak_remote_state_ensure_subsummary (FlatpakRemoteState *self, g_autoptr(GBytes) bytes = NULL; + g_return_val_if_fail (arch != NULL, FALSE); + if (self->summary != NULL) return TRUE; /* We have them all anyway */