mirror of
https://github.com/reactos/wine.git
synced 2024-12-03 01:12:25 +00:00
comctl32/propsheet: Enforce minimal PROPSHEETPAGE structure size when creating a page.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b5b26c204f
commit
a3aa217f03
@ -2957,8 +2957,12 @@ static LPWSTR load_string( HINSTANCE instance, LPCWSTR str )
|
||||
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
||||
LPCPROPSHEETPAGEA lpPropSheetPage)
|
||||
{
|
||||
PROPSHEETPAGEW* ppsp = Alloc(sizeof(PROPSHEETPAGEW));
|
||||
PROPSHEETPAGEW *ppsp;
|
||||
|
||||
if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE)
|
||||
return NULL;
|
||||
|
||||
ppsp = Alloc(sizeof(PROPSHEETPAGEW));
|
||||
memcpy(ppsp,lpPropSheetPage,min(lpPropSheetPage->dwSize,sizeof(PROPSHEETPAGEA)));
|
||||
|
||||
ppsp->dwFlags &= ~ PSP_INTERNAL_UNICODE;
|
||||
@ -3023,8 +3027,12 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
||||
*/
|
||||
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
|
||||
{
|
||||
PROPSHEETPAGEW* ppsp = Alloc(sizeof(PROPSHEETPAGEW));
|
||||
PROPSHEETPAGEW *ppsp;
|
||||
|
||||
if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE)
|
||||
return NULL;
|
||||
|
||||
ppsp = Alloc(sizeof(PROPSHEETPAGEW));
|
||||
memcpy(ppsp,lpPropSheetPage,min(lpPropSheetPage->dwSize,sizeof(PROPSHEETPAGEW)));
|
||||
|
||||
ppsp->dwFlags |= PSP_INTERNAL_UNICODE;
|
||||
|
@ -1076,7 +1076,6 @@ static void test_CreatePropertySheetPage(void)
|
||||
hpsp = CreatePropertySheetPageA(&page.u.pageA);
|
||||
|
||||
if (page.u.pageA.dwSize < PROPSHEETPAGEA_V1_SIZE)
|
||||
todo_wine
|
||||
ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageA.dwSize);
|
||||
else
|
||||
{
|
||||
@ -1108,7 +1107,6 @@ static void test_CreatePropertySheetPage(void)
|
||||
hpsp = CreatePropertySheetPageW(&page.u.pageW);
|
||||
|
||||
if (page.u.pageW.dwSize < PROPSHEETPAGEW_V1_SIZE)
|
||||
todo_wine
|
||||
ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageW.dwSize);
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user