From: Torsten Dreyer Date: Tue, 28 Jun 2011 10:51:00 +0000 (+0200) Subject: Fix #357: Enabling "fixes" on map dialog crashes FG X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=279fbdc8377438c8760eeb8d5b40a3d260af3915;p=flightgear.git Fix #357: Enabling "fixes" on map dialog crashes FG This happened for fixes with names shorter than 5 characters. range check added, which operator[] does not perform. --- diff --git a/src/GUI/MapWidget.cxx b/src/GUI/MapWidget.cxx index e3cc5de77..b6f344497 100644 --- a/src/GUI/MapWidget.cxx +++ b/src/GUI/MapWidget.cxx @@ -917,7 +917,7 @@ public: virtual bool pass(FGPositioned* aPos) const { if (_fixes && (aPos->type() == FGPositioned::FIX)) { // ignore fixes which end in digits - expirmental - if (isdigit(aPos->ident()[3]) && isdigit(aPos->ident()[4])) { + if (aPos->ident().length() > 4 && isdigit(aPos->ident()[3]) && isdigit(aPos->ident()[4])) { return false; } }