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
c6dd1419
Commit
c6dd1419
authored
May 13, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix parameter validation for LVM_SETITEMTEXT.
parent
2096d901
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
listview.c
dlls/comctl32/listview.c
+2
-2
listview.c
dlls/comctl32/tests/listview.c
+35
-0
No files found.
dlls/comctl32/listview.c
View file @
c6dd1419
...
...
@@ -8785,8 +8785,8 @@ static BOOL LISTVIEW_SetItemTextT(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
{
LVITEMW
lvItem
;
if
(
nItem
<
0
&&
nItem
>=
infoPtr
->
nItemCount
)
return
FALSE
;
if
(
!
lpLVItem
||
nItem
<
0
||
nItem
>=
infoPtr
->
nItemCount
)
return
FALSE
;
lvItem
.
iItem
=
nItem
;
lvItem
.
iSubItem
=
lpLVItem
->
iSubItem
;
lvItem
.
mask
=
LVIF_TEXT
;
...
...
dlls/comctl32/tests/listview.c
View file @
c6dd1419
...
...
@@ -4710,6 +4710,40 @@ static void test_dispinfo(void)
DestroyWindow
(
hwnd
);
}
static
void
test_LVM_SETITEMTEXT
(
void
)
{
static
char
testA
[]
=
"TEST"
;
LVITEMA
item
;
HWND
hwnd
;
DWORD
ret
;
hwnd
=
create_listview_control
(
LVS_ICON
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
insert_item
(
hwnd
,
0
);
/* null item pointer */
ret
=
SendMessage
(
hwnd
,
LVM_SETITEMTEXTA
,
0
,
0
);
expect
(
FALSE
,
ret
);
ret
=
SendMessage
(
hwnd
,
LVM_SETITEMTEXTW
,
0
,
0
);
expect
(
FALSE
,
ret
);
/* index out of bounds */
item
.
pszText
=
testA
;
item
.
cchTextMax
=
0
;
/* ignored */
ret
=
SendMessageA
(
hwnd
,
LVM_SETITEMTEXTA
,
1
,
(
LPARAM
)
&
item
);
expect
(
FALSE
,
ret
);
ret
=
SendMessageA
(
hwnd
,
LVM_SETITEMTEXTA
,
-
1
,
(
LPARAM
)
&
item
);
expect
(
FALSE
,
ret
);
ret
=
SendMessageA
(
hwnd
,
LVM_SETITEMTEXTA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
ret
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
listview
)
{
HMODULE
hComctl32
;
...
...
@@ -4774,6 +4808,7 @@ START_TEST(listview)
test_destroynotify
();
test_createdragimage
();
test_dispinfo
();
test_LVM_SETITEMTEXT
();
if
(
!
load_v6_module
(
&
ctx_cookie
,
&
hCtx
))
{
...
...
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