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
e1de222e
Commit
e1de222e
authored
Oct 13, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/comboex: Handle NULL item text case to avoid crash.
parent
d7a9e2d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
comboex.c
dlls/comctl32/comboex.c
+11
-0
comboex.c
dlls/comctl32/tests/comboex.c
+36
-0
No files found.
dlls/comctl32/comboex.c
View file @
e1de222e
...
...
@@ -510,6 +510,17 @@ static UINT COMBOEX_GetListboxText(const COMBOEX_INFO *infoPtr, INT_PTR n, LPWST
return
0
;
str
=
COMBOEX_GetText
(
infoPtr
,
item
);
if
(
!
str
)
{
if
(
buf
)
{
if
(
infoPtr
->
unicode
)
buf
[
0
]
=
0
;
else
*
((
LPSTR
)
buf
)
=
0
;
}
return
0
;
}
if
(
infoPtr
->
unicode
)
{
...
...
dlls/comctl32/tests/comboex.c
View file @
e1de222e
...
...
@@ -288,6 +288,41 @@ static void test_WM_LBUTTONDOWN(void)
DestroyWindow
(
hComboEx
);
}
static
void
test_CB_GETLBTEXT
(
void
)
{
HWND
hCombo
;
CHAR
buff
[
1
];
COMBOBOXEXITEMA
item
;
LRESULT
ret
;
hCombo
=
createComboEx
(
WS_BORDER
|
WS_VISIBLE
|
WS_CHILD
|
CBS_DROPDOWN
);
/* set text to null */
addItem
(
hCombo
,
0
,
NULL
);
buff
[
0
]
=
'a'
;
item
.
mask
=
CBEIF_TEXT
;
item
.
iItem
=
0
;
item
.
pszText
=
buff
;
item
.
cchTextMax
=
1
;
ret
=
SendMessage
(
hCombo
,
CBEM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
!=
0
,
"CBEM_GETITEM failed
\n
"
);
ok
(
buff
[
0
]
==
0
,
"
\n
"
);
ret
=
SendMessage
(
hCombo
,
CB_GETLBTEXTLEN
,
0
,
0
);
ok
(
ret
==
0
,
"Expected zero length
\n
"
);
ret
=
SendMessage
(
hCombo
,
CB_GETLBTEXTLEN
,
0
,
0
);
ok
(
ret
==
0
,
"Expected zero length
\n
"
);
buff
[
0
]
=
'a'
;
ret
=
SendMessage
(
hCombo
,
CB_GETLBTEXT
,
0
,
(
LPARAM
)
buff
);
ok
(
ret
==
0
,
"Expected zero length
\n
"
);
ok
(
buff
[
0
]
==
0
,
"Expected null terminator as a string, got %s
\n
"
,
buff
);
DestroyWindow
(
hCombo
);
}
static
LRESULT
CALLBACK
ComboExTestWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
...
...
@@ -362,6 +397,7 @@ START_TEST(comboex)
test_comboboxex
();
test_WM_LBUTTONDOWN
();
test_CB_GETLBTEXT
();
cleanup
();
}
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