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
f517022e
Commit
f517022e
authored
Oct 04, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix an invalid write in build_default_format (Valgrind).
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3af7371
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
format.c
dlls/msi/format.c
+15
-16
No files found.
dlls/msi/format.c
View file @
f517022e
...
@@ -339,29 +339,28 @@ static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound,
...
@@ -339,29 +339,28 @@ static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound,
return
replaced
;
return
replaced
;
}
}
static
LPWSTR
build_default_format
(
const
MSIRECORD
*
record
)
static
WCHAR
*
build_default_format
(
const
MSIRECORD
*
record
)
{
{
int
i
;
int
count
;
WCHAR
*
rc
,
buf
[
26
];
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
':'
,
' '
,
'['
,
'%'
,
'i'
,
']'
,
' '
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
':'
,
' '
,
'['
,
'%'
,
'i'
,
']'
,
' '
,
0
};
DWORD
size
;
int
i
,
count
=
MSI_RecordGetFieldCount
(
record
);
WCHAR
*
ret
,
*
tmp
,
buf
[
26
];
DWORD
size
=
1
;
count
=
MSI_RecordGetFieldCount
(
record
);
if
(
!
(
ret
=
msi_alloc
(
sizeof
(
*
ret
)
)))
return
NULL
;
ret
[
0
]
=
0
;
rc
=
msi_alloc
(
1
);
rc
[
0
]
=
0
;
size
=
1
;
for
(
i
=
1
;
i
<=
count
;
i
++
)
for
(
i
=
1
;
i
<=
count
;
i
++
)
{
{
sprintfW
(
buf
,
fmt
,
i
,
i
);
size
+=
sprintfW
(
buf
,
fmt
,
i
,
i
);
size
+=
lstrlenW
(
buf
);
if
(
!
(
tmp
=
msi_realloc
(
ret
,
size
*
sizeof
(
*
ret
)
)))
rc
=
msi_realloc
(
rc
,
size
*
sizeof
(
WCHAR
));
{
lstrcatW
(
rc
,
buf
);
msi_free
(
ret
);
return
NULL
;
}
ret
=
tmp
;
strcatW
(
ret
,
buf
);
}
}
return
ret
;
return
rc
;
}
}
static
BOOL
format_is_number
(
WCHAR
x
)
static
BOOL
format_is_number
(
WCHAR
x
)
...
...
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