[ros-dev] [ros-diffs] [gedmurphy] 36435: Don't risk a negative array subscript. Fixes our one and only REVERSE_NEGATIVE error Fix for Coverity error CID: 766
Timo Kreuzer
timo.kreuzer at web.de
Wed Sep 24 02:02:34 CEST 2008
For me it looks like you try to trick Coverity here. No real fix, unless
you check for (nColor >= 0)
gedmurphy at svn.reactos.org schrieb:
> Author: gedmurphy
> Date: Tue Sep 23 14:02:32 2008
> New Revision: 36435
>
> URL: http://svn.reactos.org/svn/reactos?rev=36435&view=rev
> Log:
> Don't risk a negative array subscript. Fixes our one and only REVERSE_NEGATIVE error
> Fix for Coverity error CID: 766
>
> Modified:
> trunk/reactos/dll/cpl/desk/advappdlg.c
>
> Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
> URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?rev=36435&r1=36434&r2=36435&view=diff
> ==============================================================================
> --- trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] (original)
> +++ trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] Tue Sep 23 14:02:32 2008
> @@ -23,7 +23,6 @@
> RECT rect;
> HBRUSH hbrush;
> HWND hwndColorButton;
> - COLORREF crColor = g->ThemeAdv.crColor[nColor];
> HGDIOBJ hgdiTmp;
>
> if (nColor != -1)
> @@ -42,7 +41,7 @@
> rect.top = 2;
> rect.right = 22;
> rect.bottom = 13;
> - hbrush = CreateSolidBrush(crColor);
> + hbrush = CreateSolidBrush(g->ThemeAdv.crColor[nColor]);
> FillRect(hdcCompat, &rect, hbrush);
> DeleteObject(hbrush);
>
>
>
>
More information about the Ros-dev
mailing list