View Issue Details

IDProjectCategoryView StatusLast Update
0007064ardourbugspublic2016-10-12 19:36
Reporternstewart Assigned Topaul  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformallOSall 
Product Version5.X git (version in description) 
Summary0007064: array index out of bounds in push2
DescriptionArray index out of bounds possible in Push2Menu::set_active()

As of 631c8afc66

[libs/surfaces/push2/menu.cc:234]: (error) When _active==displays.size(), displays[_active] is out of bounds.
TagsNo tags attached.

Activities

nstewart

2016-10-09 16:10

reporter  

0001-Fixed-array-index-out-of-bounds-in-Push2Menu-set_act.patch (753 bytes)   
From c17e781dbda5e0a88725fb2a05b02cae41fc12d8 Mon Sep 17 00:00:00 2001
From: Nathan Stewart <therealnathanstewart@gmail.com>
Date: Sun, 9 Oct 2016 08:26:59 -0400
Subject: [PATCH] Fixed array index out of bounds in Push2Menu::set_active()

---
 libs/surfaces/push2/menu.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/surfaces/push2/menu.cc b/libs/surfaces/push2/menu.cc
index 116da8a..b6558ac 100644
--- a/libs/surfaces/push2/menu.cc
+++ b/libs/surfaces/push2/menu.cc
@@ -230,7 +230,7 @@ Push2Menu::set_active (uint32_t index)
 
 	/* set text color for old active item, and the new one */
 
-	if (_active <= displays.size()) {
+	if (_active < displays.size()) {
 		displays[_active]->set_color (text_color);
 	}
 
-- 
2.7.4

paul

2016-10-12 19:17

administrator   ~0018788

applied via email from reporter, along two other issues discovered by cppcheck

Issue History

Date Modified Username Field Change
2016-10-09 16:10 nstewart New Issue
2016-10-09 16:10 nstewart File Added: 0001-Fixed-array-index-out-of-bounds-in-Push2Menu-set_act.patch
2016-10-12 19:17 paul Note Added: 0018788
2016-10-12 19:17 paul Status new => resolved
2016-10-12 19:17 paul Resolution open => fixed
2016-10-12 19:17 paul Assigned To => paul
2016-10-12 19:36 nstewart Status resolved => closed