mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 15:55:03 +00:00
wbemprox: Fix out-of-bounds access caused by codepoints above U+00FF.
Windows seems to recognize Unicode codepoints above U+007F as a valid identifier character regardless of their actual character class. Mimic that behaviour.
This commit is contained in:
parent
0fac6c11f2
commit
67fbcff745
|
@ -94,6 +94,12 @@ static void test_select( IWbemServices *services )
|
|||
L"SELECT * FROM Win32_BIOS WHERE NULL = NAME",
|
||||
L"SELECT * FROM Win32_LogicalDiskToPartition",
|
||||
L"SELECT * FROM Win32_DiskDriveToDiskPartition",
|
||||
L"SELECT \x80 FROM \x80",
|
||||
L"SELECT \xC6 FROM \xC6",
|
||||
L"SELECT \xFF FROM \xFF",
|
||||
L"SELECT \x200C FROM \x200C",
|
||||
L"SELECT \xFF21 FROM \xFF21",
|
||||
L"SELECT \xFFFD FROM \xFFFD",
|
||||
};
|
||||
HRESULT hr;
|
||||
IEnumWbemClassObject *result;
|
||||
|
|
|
@ -645,6 +645,11 @@ static const char id_char[] =
|
|||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
};
|
||||
|
||||
static int is_idchar(WCHAR chr)
|
||||
{
|
||||
return chr >= ARRAY_SIZE(id_char) || id_char[chr];
|
||||
}
|
||||
|
||||
struct wql_keyword
|
||||
{
|
||||
const WCHAR *name;
|
||||
|
@ -802,9 +807,9 @@ static int get_token( const WCHAR *s, int *token )
|
|||
for (i = 1; is_digit( s[i] ); i++) {}
|
||||
return i;
|
||||
default:
|
||||
if (!id_char[*s]) break;
|
||||
if (!is_idchar(*s)) break;
|
||||
|
||||
for (i = 1; id_char[s[i]]; i++) {}
|
||||
for (i = 1; is_idchar(s[i]); i++) {}
|
||||
*token = keyword_type( s, i );
|
||||
return i;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue