[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH 1/5] comctl32/listbox: Check for out of bounds index using an unsigned index
From:       Gabriel Ivăncescu <gabrielopcode () gmail ! com>
Date:       2019-01-31 15:23:19
Message-ID: 0f473ed9b1adcf588cf8f7c2b1b371adcc365038.1548948127.git.gabrielopcode () gmail ! com
[Download RAW message or body]

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
---
 dlls/comctl32/listbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index cb645b4..71f1c05 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -489,7 +489,7 @@ static INT LISTBOX_GetItemFromPoint( const LB_DESCR *descr, INT x, INT y )
  * Paint an item.
  */
 static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
-			       INT index, UINT action, BOOL ignoreFocus )
+			       UINT index, UINT action, BOOL ignoreFocus )
 {
     BOOL selected = FALSE, focused;
     LB_ITEMDATA *item = NULL;
@@ -508,7 +508,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
         RECT r;
         HRGN hrgn;
 
-	if (!item)
+	if (index >= descr->nb_items)
 	{
 	    if (action == ODA_FOCUS)
 		DrawFocusRect( hdc, rect );
-- 
2.19.1




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic