wbemprox: Use a terminated string in parse_resource.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48245 Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
93a7a9037a
commit
76ee089aad
|
@ -98,7 +98,7 @@ static BOOL is_local_machine( const WCHAR *server )
|
||||||
|
|
||||||
static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **namespace )
|
static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **namespace )
|
||||||
{
|
{
|
||||||
static const WCHAR rootW[] = {'R','O','O','T'};
|
static const WCHAR rootW[] = {'R','O','O','T',0};
|
||||||
static const WCHAR cimv2W[] = {'C','I','M','V','2',0};
|
static const WCHAR cimv2W[] = {'C','I','M','V','2',0};
|
||||||
static const WCHAR defaultW[] = {'D','E','F','A','U','L','T',0};
|
static const WCHAR defaultW[] = {'D','E','F','A','U','L','T',0};
|
||||||
HRESULT hr = WBEM_E_INVALID_NAMESPACE;
|
HRESULT hr = WBEM_E_INVALID_NAMESPACE;
|
||||||
|
@ -131,7 +131,7 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na
|
||||||
p = q;
|
p = q;
|
||||||
while (*q && *q != '\\' && *q != '/') q++;
|
while (*q && *q != '\\' && *q != '/') q++;
|
||||||
len = q - p;
|
len = q - p;
|
||||||
if (len >= ARRAY_SIZE( rootW ) && wcsnicmp( rootW, p, len )) goto done;
|
if (len >= ARRAY_SIZE( rootW ) - 1 && wcsnicmp( rootW, p, len )) goto done;
|
||||||
if (!*q)
|
if (!*q)
|
||||||
{
|
{
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
|
|
Loading…
Reference in New Issue