From d2f364bbd78837e225382f6c229e2a6bfcf19f74 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 29 Jun 2026 22:14:50 +0200 Subject: [PATCH] locale-utils: Ensure the flatpak lang only contains a-zA-Z This should be the case anyway right now and makes it easier to ensure the code using it is correct. --- common/flatpak-locale-utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/flatpak-locale-utils.c b/common/flatpak-locale-utils.c index 2908e0fb7..f45541f60 100644 --- a/common/flatpak-locale-utils.c +++ b/common/flatpak-locale-utils.c @@ -64,6 +64,12 @@ flatpak_get_lang_from_locale (const char *locale) if (strcmp (lang, "C") == 0) return NULL; + for (c = lang; *c != 0; c++) + { + if (!g_ascii_isalpha (*c)) + return NULL; + } + return g_steal_pointer (&lang); }