From ffd6e7fc7a3af65313f32497a327a8290d8350f2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Jul 2016 15:38:34 +0200 Subject: [PATCH] src/gui/widget/menue.cpp fix possible heap-buffer-overflow Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5be8af9890a0c6e368203a9ede976518ea29674e Author: Jacek Jendrzej Date: 2016-07-21 (Thu, 21 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 4935cf5bf..607be4f60 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1311,9 +1311,9 @@ void CMenuWidget::paintItems() //Item not currently on screen if (selected >= 0) { - while (selected < page_start[current_page]) + while (current_page > 0 && selected < page_start[current_page]) current_page--; - while (selected >= page_start[current_page + 1]) + while (current_page+1 < page_start.size() && selected >= page_start[current_page + 1]) current_page++; }