Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
cea239e9
Commit
cea239e9
authored
May 08, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Use strncmpiW instead of memicmpW for strings without embedded nulls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3c53e06b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
wbemlocator.c
dlls/wbemprox/wbemlocator.c
+4
-5
wql.y
dlls/wbemprox/wql.y
+1
-1
No files found.
dlls/wbemprox/wbemlocator.c
View file @
cea239e9
...
...
@@ -101,8 +101,8 @@ static BOOL is_local_machine( const WCHAR *server )
static
HRESULT
parse_resource
(
const
WCHAR
*
resource
,
WCHAR
**
server
,
WCHAR
**
namespace
)
{
static
const
WCHAR
rootW
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
};
static
const
WCHAR
cimv2W
[]
=
{
'C'
,
'I'
,
'M'
,
'V'
,
'2'
};
static
const
WCHAR
defaultW
[]
=
{
'D'
,
'E'
,
'F'
,
'A'
,
'U'
,
'L'
,
'T'
};
static
const
WCHAR
cimv2W
[]
=
{
'C'
,
'I'
,
'M'
,
'V'
,
'2'
,
0
};
static
const
WCHAR
defaultW
[]
=
{
'D'
,
'E'
,
'F'
,
'A'
,
'U'
,
'L'
,
'T'
,
0
};
HRESULT
hr
=
WBEM_E_INVALID_NAMESPACE
;
const
WCHAR
*
p
,
*
q
;
unsigned
int
len
;
...
...
@@ -133,7 +133,7 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na
p
=
q
;
while
(
*
q
&&
*
q
!=
'\\'
&&
*
q
!=
'/'
)
q
++
;
len
=
q
-
p
;
if
(
len
>=
ARRAY_SIZE
(
rootW
)
&&
memicmp
W
(
rootW
,
p
,
len
))
goto
done
;
if
(
len
>=
ARRAY_SIZE
(
rootW
)
&&
strncmpi
W
(
rootW
,
p
,
len
))
goto
done
;
if
(
!*
q
)
{
hr
=
S_OK
;
...
...
@@ -141,8 +141,7 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na
}
q
++
;
len
=
strlenW
(
q
);
if
((
len
!=
ARRAY_SIZE
(
cimv2W
)
||
memicmpW
(
q
,
cimv2W
,
len
))
&&
(
len
!=
ARRAY_SIZE
(
defaultW
)
||
memicmpW
(
q
,
defaultW
,
len
)))
if
(
strcmpiW
(
q
,
cimv2W
)
&&
strcmpiW
(
q
,
defaultW
))
goto
done
;
if
(
!
(
*
namespace
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
hr
=
E_OUTOFMEMORY
;
else
...
...
dlls/wbemprox/wql.y
View file @
cea239e9
...
...
@@ -579,7 +579,7 @@ static int cmp_keyword( const void *arg1, const void *arg2 )
int len = min( key1->len, key2->len );
int ret;
if ((ret =
memicmp
W( key1->name, key2->name, len ))) return ret;
if ((ret =
strncmpi
W( key1->name, key2->name, len ))) return ret;
if (key1->len < key2->len) return -1;
else if (key1->len > key2->len) return 1;
return 0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment