commit 357b9918 Author: Gleb Popov <6yearold@gmail.com> Date: Thu Apr 13 15:07:48 2023 +0300 Fix crash in asc_l10n_search_translations_qt() We can't change value of the pointer that is marked `g_autofree`. Fixes #483 Sponsored by: Serenity Cybersecurity, LLC diff --git a/compose/asc-utils-l10n.c b/compose/asc-utils-l10n.c index 74e4985d..4c82210f 100644 --- a/compose/asc-utils-l10n.c +++ b/compose/asc-utils-l10n.c @@ -389,12 +389,9 @@ asc_l10n_search_translations_qt (AscLocaleContext *ctx, continue; locale = g_strdup (fname + strlen (qm_root) + 1); g_strdelimit (locale, ".", '\0'); + /* tmp == NULL means we have the ${hint}/${locale}.qm form */ tmp = g_strstr_len (locale, -1, "/"); - if (tmp != NULL) { - /* we have the ${hint}/${locale}.qm form */ - locale = tmp + 1; - } - if (!asc_l10n_parse_file_qt (ctx, unit, locale, fname, error)) + if (!asc_l10n_parse_file_qt (ctx, unit, tmp == NULL ? locale : tmp + 1, fname, error)) return FALSE; } }