From d6246131d2a3170fd139f6a2880a9f6b621c04b9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 19 Dec 2015 20:18:49 +0100 Subject: [PATCH] src/gui/channellist.cpp fix possible segfault after edit mode (heap-buffer-overflow) --- src/gui/channellist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 4dc660589..5336a8ae4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1850,6 +1850,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) iscurrent = SameTP((*chanlist)[curr]); } + if(selected >= (*chanlist).size()) + selected = (*chanlist).size()-1; + if (curr == selected) { color = COL_MENUCONTENTSELECTED_TEXT; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;