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
51013ad2
Commit
51013ad2
authored
Nov 09, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use FIELD_OFFSET to calculate the size of structs with variable length array.
parent
9c431b67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
dialog.c
dlls/msi/dialog.c
+2
-2
table.c
dlls/msi/table.c
+1
-1
No files found.
dlls/msi/dialog.c
View file @
51013ad2
...
...
@@ -309,7 +309,7 @@ static UINT msi_dialog_add_font( MSIRECORD *rec, LPVOID param )
/* create a font and add it to the list */
name
=
MSI_RecordGetString
(
rec
,
1
);
font
=
msi_alloc
(
sizeof
*
font
+
strlenW
(
name
)
*
sizeof
(
WCHAR
)
);
font
=
msi_alloc
(
FIELD_OFFSET
(
msi_font
,
name
[
strlenW
(
name
)
+
1
]
)
);
strcpyW
(
font
->
name
,
name
);
list_add_head
(
&
dialog
->
fonts
,
&
font
->
entry
);
...
...
@@ -414,7 +414,7 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
style
|=
WS_CHILD
;
control
=
msi_alloc
(
sizeof
*
control
+
strlenW
(
name
)
*
sizeof
(
WCHAR
)
);
control
=
msi_alloc
(
FIELD_OFFSET
(
msi_control
,
name
[
strlenW
(
name
)
+
1
]
)
);
if
(
!
control
)
return
NULL
;
...
...
dlls/msi/table.c
View file @
51013ad2
...
...
@@ -2141,7 +2141,7 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view )
else
if
(
!
strcmpW
(
name
,
szStorages
)
)
return
STORAGES_CreateView
(
db
,
view
);
sz
=
sizeof
*
tv
+
lstrlenW
(
name
)
*
sizeof
name
[
0
]
;
sz
=
FIELD_OFFSET
(
MSITABLEVIEW
,
name
[
lstrlenW
(
name
)
+
1
]
)
;
tv
=
msi_alloc_zero
(
sz
);
if
(
!
tv
)
return
ERROR_FUNCTION_FAILED
;
...
...
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