From 053d405a5cead6c160d9037ddfde3bbffb24d7e9 Mon Sep 17 00:00:00 2001 From: jmt Date: Sun, 20 Dec 2009 22:19:32 +0000 Subject: [PATCH] GPS: make 'loadRouteWaypoint' robust about bad scratch/index values. --- src/Instrumentation/gps.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 0343a19d2..1dd72d9fc 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -1381,7 +1381,7 @@ void GPS::loadRouteWaypoint() int index = _scratchNode->getIntValue("index", -9999); clearScratch(); - if (index == -9999) { // no index supplied, use current wp + if ((index < 0) || (index >= _routeMgr->size())) { // no index supplied, use current wp index = _routeMgr->currentWaypoint(); } -- 2.39.5