Commit 6d68c38c authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ee1880a7
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment