diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c index 1dbad3f28bb..ed771e7318c 100644 --- a/dlls/kernel/locale.c +++ b/dlls/kernel/locale.c @@ -1034,6 +1034,12 @@ BOOL WINAPI SetLocaleInfoA(LCID lcid, LCTYPE lctype, LPCSTR data) lcid = ConvertDefaultLocale(lcid); if (!(lctype & LOCALE_USE_CP_ACP)) codepage = get_lcid_codepage( lcid ); + + if (!data) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } len = MultiByteToWideChar( codepage, 0, data, -1, NULL, 0 ); if (!(strW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) {