From 98ece04660ca1e0640143e20b0b0c71b3c970718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Thu, 7 Feb 2019 15:12:20 +0200 Subject: [PATCH] comctl32/listbox: Check for out of bounds using the index when painting the item. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed for LBS_NODATA. Signed-off-by: Gabriel Ivăncescu Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/comctl32/listbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index cb645b44672..9e6d8ea8dc5 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -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 );