]> git.mxchange.org Git - flightgear.git/commitdiff
Fix #357: Enabling "fixes" on map dialog crashes FG
authorTorsten Dreyer <Torsten@t3r.de>
Tue, 28 Jun 2011 10:51:00 +0000 (12:51 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Tue, 28 Jun 2011 10:51:00 +0000 (12:51 +0200)
This happened for fixes with names shorter than 5 characters.
range check added, which operator[] does not perform.

src/GUI/MapWidget.cxx

index e3cc5de772d8aa4dab79d706316a7c52ec753579..b6f34449718f263b2220ee89cba3a1a8e898150a 100644 (file)
@@ -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;
       }
     }