[PATCH v2 0/1] MR8421: dxgi/tests: Fix out-of-bound in test_cursor_clipping.
Missing a bound check for "modes". -- v2: dxgi/tests: Fix out-of-bound in test_cursor_clipping. https://gitlab.winehq.org/wine/wine/-/merge_requests/8421
From: Yuxuan Shui <yshui(a)codeweavers.com> Missing a bound check for "modes". --- dlls/dxgi/tests/dxgi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index cb8bec5c666..03bccc50a37 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -6912,8 +6912,9 @@ static void test_cursor_clipping(IUnknown *device, BOOL is_d3d12) if (modes[mode_idx].Width != width && modes[mode_idx].Height != height) break; } - ok(modes[mode_idx].Width != width && modes[mode_idx].Height != height, - "Failed to find a different mode than %ux%u.\n", width, height); + ok(mode_idx < mode_count, "Failed to find a different mode than %ux%u.\n", width, height); + if (mode_idx >= mode_count) + continue; ret = ClipCursor(NULL); ok(ret, "ClipCursor failed, error %#lx.\n", GetLastError()); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8421
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8421
This merge request was approved by Jan Sikorski. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8421
participants (4)
-
Elizabeth Figura (@zfigura) -
Jan Sikorski (@jsikorski) -
Yuxuan Shui -
Yuxuan Shui (@yshui)