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
587e1073
Commit
587e1073
authored
Feb 22, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Allocate sufficient memory in ITERATE_InstallODBCDriver and ITERATE_InstallODBCTranslator.
Found by Valgrind.
parent
a620a84f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
action.c
dlls/msi/action.c
+12
-12
No files found.
dlls/msi/action.c
View file @
587e1073
...
...
@@ -5110,7 +5110,7 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
len
=
lstrlenW
(
desc
)
+
lstrlenW
(
driver_fmt
)
+
lstrlenW
(
driver_file
->
FileName
);
if
(
setup_file
)
len
+=
lstrlenW
(
setup_fmt
)
+
lstrlenW
(
setup_file
->
FileName
);
len
+=
lstrlenW
(
usage_fmt
)
+
1
;
len
+=
lstrlenW
(
usage_fmt
)
+
2
;
/* \0\0 */
driver
=
msi_alloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
driver
)
...
...
@@ -5120,13 +5120,13 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
lstrcpyW
(
ptr
,
desc
);
ptr
+=
lstrlenW
(
ptr
)
+
1
;
sprintfW
(
ptr
,
driver_fmt
,
driver_file
->
FileName
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
len
=
sprintfW
(
ptr
,
driver_fmt
,
driver_file
->
FileName
);
ptr
+=
l
en
+
1
;
if
(
setup_file
)
{
sprintfW
(
ptr
,
setup_fmt
,
setup_file
->
FileName
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
len
=
sprintfW
(
ptr
,
setup_fmt
,
setup_file
->
FileName
);
ptr
+=
l
en
+
1
;
}
lstrcpyW
(
ptr
,
usage_fmt
);
...
...
@@ -5176,7 +5176,7 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
return
ERROR_FUNCTION_FAILED
;
}
len
=
lstrlenW
(
desc
)
+
lstrlenW
(
translator_fmt
)
+
lstrlenW
(
translator_file
->
FileName
)
+
1
;
len
=
lstrlenW
(
desc
)
+
lstrlenW
(
translator_fmt
)
+
lstrlenW
(
translator_file
->
FileName
)
+
2
;
/* \0\0 */
if
(
setup_file
)
len
+=
lstrlenW
(
setup_fmt
)
+
lstrlenW
(
setup_file
->
FileName
);
...
...
@@ -5188,13 +5188,13 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
lstrcpyW
(
ptr
,
desc
);
ptr
+=
lstrlenW
(
ptr
)
+
1
;
sprintfW
(
ptr
,
translator_fmt
,
translator_file
->
FileName
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
len
=
sprintfW
(
ptr
,
translator_fmt
,
translator_file
->
FileName
);
ptr
+=
l
en
+
1
;
if
(
setup_file
)
{
sprintfW
(
ptr
,
setup_fmt
,
setup_file
->
FileName
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
len
=
sprintfW
(
ptr
,
setup_fmt
,
setup_file
->
FileName
);
ptr
+=
l
en
+
1
;
}
*
ptr
=
'\0'
;
...
...
@@ -5234,7 +5234,7 @@ static UINT ITERATE_InstallODBCDataSource( MSIRECORD *rec, LPVOID param )
if
(
registration
==
msidbODBCDataSourceRegistrationPerMachine
)
request
=
ODBC_ADD_SYS_DSN
;
else
if
(
registration
==
msidbODBCDataSourceRegistrationPerUser
)
request
=
ODBC_ADD_DSN
;
len
=
lstrlenW
(
attrs_fmt
)
+
lstrlenW
(
desc
)
+
1
+
1
;
len
=
lstrlenW
(
attrs_fmt
)
+
lstrlenW
(
desc
)
+
2
;
/* \0\0 */
attrs
=
msi_alloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
attrs
)
return
ERROR_OUTOFMEMORY
;
...
...
@@ -5348,7 +5348,7 @@ static UINT ITERATE_RemoveODBCDataSource( MSIRECORD *rec, LPVOID param )
if
(
registration
==
msidbODBCDataSourceRegistrationPerMachine
)
request
=
ODBC_REMOVE_SYS_DSN
;
else
if
(
registration
==
msidbODBCDataSourceRegistrationPerUser
)
request
=
ODBC_REMOVE_DSN
;
len
=
strlenW
(
attrs_fmt
)
+
strlenW
(
desc
)
+
1
+
1
;
len
=
strlenW
(
attrs_fmt
)
+
strlenW
(
desc
)
+
2
;
/* \0\0 */
attrs
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
!
attrs
)
return
ERROR_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