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
687c4f5c
Commit
687c4f5c
authored
Feb 03, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle memory allocation failure in get_link_file (cppcheck).
parent
b0e65dbe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
action.c
dlls/msi/action.c
+7
-3
No files found.
dlls/msi/action.c
View file @
687c4f5c
...
...
@@ -3655,7 +3655,7 @@ static UINT ACTION_UnregisterTypeLibraries( MSIPACKAGE *package )
static
WCHAR
*
get_link_file
(
MSIPACKAGE
*
package
,
MSIRECORD
*
row
)
{
LPCWSTR
directory
,
extension
,
link_folder
;
LPWSTR
link_file
,
filename
;
WCHAR
*
link_file
=
NULL
,
*
filename
,
*
new_
filename
;
directory
=
MSI_RecordGetString
(
row
,
2
);
link_folder
=
msi_get_target_folder
(
package
,
directory
);
...
...
@@ -3668,18 +3668,22 @@ static WCHAR *get_link_file( MSIPACKAGE *package, MSIRECORD *row )
msi_create_full_path
(
package
,
link_folder
);
filename
=
msi_dup_record_field
(
row
,
3
);
if
(
!
filename
)
return
NULL
;
msi_reduce_to_long_filename
(
filename
);
extension
=
wcsrchr
(
filename
,
'.'
);
if
(
!
extension
||
wcsicmp
(
extension
,
L".lnk"
))
{
int
len
=
lstrlenW
(
filename
);
filename
=
realloc
(
filename
,
len
*
sizeof
(
WCHAR
)
+
sizeof
(
L".lnk"
)
);
new_filename
=
realloc
(
filename
,
len
*
sizeof
(
WCHAR
)
+
sizeof
(
L".lnk"
)
);
if
(
!
new_filename
)
goto
done
;
filename
=
new_filename
;
memcpy
(
filename
+
len
,
L".lnk"
,
sizeof
(
L".lnk"
)
);
}
link_file
=
msi_build_directory_name
(
2
,
link_folder
,
filename
);
free
(
filename
);
done:
free
(
filename
);
return
link_file
;
}
...
...
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