user32/tests: Zero initialize DEVMODE before passing it to EnumDisplaySettings().
Zero initialize DEVMODE before passing it to EnumDisplaySettings(), which may write beyond the end of the DEVMODE structure on Windows because the dmDriverExtra field is uninitialized. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ee1880a756
commit
6d68c38c88
|
@ -514,6 +514,7 @@ static void test_ChangeDisplaySettingsEx(void)
|
|||
|
||||
devices[device_count].index = device;
|
||||
lstrcpyA(devices[device_count].name, dd.DeviceName);
|
||||
memset(&devices[device_count].original_mode, 0, sizeof(devices[device_count].original_mode));
|
||||
devices[device_count].original_mode.dmSize = sizeof(devices[device_count].original_mode);
|
||||
res = EnumDisplaySettingsA(dd.DeviceName, ENUM_CURRENT_SETTINGS, &devices[device_count].original_mode);
|
||||
ok(res, "EnumDisplaySettingsA %s failed, error %#x\n", dd.DeviceName, GetLastError());
|
||||
|
|
Loading…
Reference in New Issue