From: jmt Date: Sun, 20 Dec 2009 22:19:32 +0000 (+0000) Subject: GPS: make 'loadRouteWaypoint' robust about bad scratch/index values. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=053d405a5cead6c160d9037ddfde3bbffb24d7e9;p=flightgear.git GPS: make 'loadRouteWaypoint' robust about bad scratch/index values. --- 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(); }