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
86ab6bc9
Commit
86ab6bc9
authored
Oct 07, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Don't use sizeof to calculate the length of a WCHAR string.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
251d0a8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
install.c
dlls/advpack/install.c
+4
-8
No files found.
dlls/advpack/install.c
View file @
86ab6bc9
...
...
@@ -446,10 +446,6 @@ static HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec,
LPCWSTR
ptr
,
path
;
static
const
WCHAR
backslash
[]
=
{
'\\'
,
0
};
static
const
WCHAR
default_install
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
if
(
!
(
ptr
=
wcsrchr
(
inf_filename
,
'\\'
)))
ptr
=
inf_filename
;
...
...
@@ -464,16 +460,16 @@ static HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec,
/* FIXME: determine the proper platform to install (NTx86, etc) */
if
(
!
install_sec
||
!*
install_sec
)
{
len
=
sizeof
(
default_install
)
-
1
;
ptr
=
default_install
;
len
=
ARRAY_SIZE
(
L"DefaultInstall"
)
;
ptr
=
L"DefaultInstall"
;
}
else
{
len
=
lstrlenW
(
install_sec
);
len
=
lstrlenW
(
install_sec
)
+
1
;
ptr
=
install_sec
;
}
info
->
install_sec
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
info
->
install_sec
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
info
->
install_sec
)
return
E_OUTOFMEMORY
;
...
...
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