kernel32: Handle NULL locale name in IsValidLocaleName().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-05-15 10:29:43 +03:00 committed by Alexandre Julliard
parent 9f5a950995
commit 73f7bf57cb
2 changed files with 5 additions and 0 deletions

View File

@ -2656,6 +2656,9 @@ BOOL WINAPI IsValidLocaleName( LPCWSTR locale )
{
struct locale_name locale_name;
if (!locale)
return FALSE;
/* string parsing */
parse_locale_name( locale, &locale_name );

View File

@ -4179,6 +4179,8 @@ static void test_IsValidLocaleName(void)
ok(!ret, "IsValidLocaleName should have failed\n");
ret = pIsValidLocaleName(LOCALE_NAME_INVARIANT);
ok(ret, "IsValidLocaleName failed\n");
ret = pIsValidLocaleName(NULL);
ok(!ret, "IsValidLocaleName should have failed\n");
}
static void test_CompareStringOrdinal(void)