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
17ffb562
Commit
17ffb562
authored
Dec 17, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix some NULL checking in MSI_RecordGetStringA.
Includes a few record tests with a NULL buffer.
parent
5c779bfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
record.c
dlls/msi/record.c
+4
-3
record.c
dlls/msi/tests/record.c
+10
-0
No files found.
dlls/msi/record.c
View file @
17ffb562
...
...
@@ -358,15 +358,16 @@ UINT MSI_RecordGetStringA(MSIRECORD *rec, UINT iField,
case
MSIFIELD_WSTR
:
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
rec
->
fields
[
iField
].
u
.
szwVal
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
rec
->
fields
[
iField
].
u
.
szwVal
,
-
1
,
szValue
,
*
pcchValue
,
NULL
,
NULL
);
if
(
szValue
)
WideCharToMultiByte
(
CP_ACP
,
0
,
rec
->
fields
[
iField
].
u
.
szwVal
,
-
1
,
szValue
,
*
pcchValue
,
NULL
,
NULL
);
if
(
szValue
&&
*
pcchValue
&&
len
>*
pcchValue
)
szValue
[
*
pcchValue
-
1
]
=
0
;
if
(
len
)
len
--
;
break
;
case
MSIFIELD_NULL
:
if
(
*
pcchValue
>
0
)
if
(
szValue
&&
*
pcchValue
>
0
)
szValue
[
0
]
=
0
;
break
;
default:
...
...
dlls/msi/tests/record.c
View file @
17ffb562
...
...
@@ -362,6 +362,11 @@ static void test_MsiRecordGetString(void)
ok
(
rec
!=
0
,
"Expected a valid handle
\n
"
);
sz
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
NULL
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
1
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
@@ -384,6 +389,11 @@ static void test_MsiRecordGetString(void)
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
sz
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
NULL
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
1
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
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