[PATCH 0/1] MR4770: win32u: Fix a possible out-of-bounds write (Coverity).
From: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/win32u/sysparams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ad6e7dce39b..a9563eaff84 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -6121,7 +6121,7 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va if (IS_INTRESOURCE(colors)) return FALSE; /* stupid app passes a color instead of an array */ for (i = 0; i < count; i++) - if (colors[i] >= 0 && colors[i] <= ARRAY_SIZE( system_colors )) + if (colors[i] >= 0 && colors[i] < ARRAY_SIZE( system_colors )) set_entry( &system_colors[colors[i]], values[i], 0, 0 ); /* Send WM_SYSCOLORCHANGE message to all windows */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4770
participants (2)
-
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)