From 076f08cb3e733d305ed3e61052584bc0f8e5edff Mon Sep 17 00:00:00 2001 From: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> Date: Sun, 8 Jun 2025 16:05:22 +0200 Subject: [PATCH] [SYSSETUP] WriteUserLocale(): Fix Locale[] length and value (#8090) 'Locale' format is "0000nnnn". CORE-15848 --- dll/win32/syssetup/wizard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 9ec3d167db7..78dd10c3d52 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -1455,11 +1455,11 @@ WriteUserLocale(VOID) { HKEY hKey; LCID lcid; - WCHAR Locale[12]; + WCHAR Locale[9] = L"0000"; lcid = GetSystemDefaultLCID(); - if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, ARRAYSIZE(Locale)) != 0) + if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0) { if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International", 0, NULL, REG_OPTION_NON_VOLATILE,