Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f776b64f
Commit
f776b64f
authored
Jan 03, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Fix buffer size query in IWbemPath::GetText.
parent
67c57b21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
path.c
dlls/wmiutils/path.c
+15
-11
No files found.
dlls/wmiutils/path.c
View file @
f776b64f
...
...
@@ -237,10 +237,10 @@ static WCHAR *build_server( struct path *path, int *len )
WCHAR
*
ret
,
*
p
;
*
len
=
0
;
if
(
path
->
server
)
*
len
+=
2
+
path
->
len_server
;
if
(
path
->
len_
server
)
*
len
+=
2
+
path
->
len_server
;
else
*
len
+=
4
;
if
(
!
(
p
=
ret
=
heap_alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
path
->
server
)
if
(
path
->
len_
server
)
{
p
[
0
]
=
p
[
1
]
=
'\\'
;
strcpyW
(
p
+
2
,
path
->
server
);
...
...
@@ -265,14 +265,14 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
if
(
!
namespace
)
return
NULL
;
*
len
=
len_namespace
;
if
(
path
->
class
)
*
len
+=
1
+
path
->
len_class
;
if
(
path
->
len_
class
)
*
len
+=
1
+
path
->
len_class
;
if
(
!
(
ret
=
heap_alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_free
(
namespace
);
return
NULL
;
}
strcpyW
(
ret
,
namespace
);
if
(
path
->
class
)
if
(
path
->
len_
class
)
{
ret
[
len_namespace
]
=
':'
;
strcpyW
(
ret
+
len_namespace
+
1
,
path
->
class
);
...
...
@@ -282,7 +282,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
}
case
WBEMPATH_GET_RELATIVE_ONLY
:
if
(
!
path
->
class
)
if
(
!
path
->
len_
class
)
{
*
len
=
0
;
return
NULL
;
...
...
@@ -303,7 +303,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
return
NULL
;
}
*
len
=
len_namespace
+
len_server
;
if
(
path
->
class
)
*
len
+=
1
+
path
->
len_class
;
if
(
path
->
len_
class
)
*
len
+=
1
+
path
->
len_class
;
if
(
!
(
p
=
ret
=
heap_alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_free
(
namespace
);
...
...
@@ -314,7 +314,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
p
+=
len_server
;
strcpyW
(
p
,
namespace
);
p
+=
len_namespace
;
if
(
path
->
class
)
if
(
path
->
len_
class
)
{
*
p
=
':'
;
strcpyW
(
p
+
1
,
path
->
class
);
...
...
@@ -353,7 +353,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
return
build_namespace
(
path
,
len
);
case
WBEMPATH_GET_ORIGINAL
:
if
(
!
path
->
text
)
if
(
!
path
->
len_
text
)
{
*
len
=
0
;
return
NULL
;
...
...
@@ -379,7 +379,7 @@ static HRESULT WINAPI path_GetText(
TRACE
(
"%p, 0x%x, %p, %p
\n
"
,
iface
,
lFlags
,
puBufferLength
,
pszText
);
if
(
!
puBufferLength
||
!
pszText
)
return
WBEM_E_INVALID_PARAMETER
;
if
(
!
puBufferLength
)
return
WBEM_E_INVALID_PARAMETER
;
str
=
build_path
(
path
,
lFlags
,
&
len
);
...
...
@@ -388,12 +388,16 @@ static HRESULT WINAPI path_GetText(
*
puBufferLength
=
len
+
1
;
return
S_OK
;
}
if
(
pszText
)
if
(
!
pszText
)
{
heap_free
(
str
);
return
WBEM_E_INVALID_PARAMETER
;
}
if
(
str
)
strcpyW
(
pszText
,
str
);
else
pszText
[
0
]
=
0
;
}
*
puBufferLength
=
len
+
1
;
TRACE
(
"<-- %s
\n
"
,
debugstr_w
(
pszText
));
heap_free
(
str
);
return
S_OK
;
}
...
...
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