From 279fbdc8377438c8760eeb8d5b40a3d260af3915 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Tue, 28 Jun 2011 12:51:00 +0200 Subject: [PATCH] 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. --- src/GUI/MapWidget.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }