1
0
Fork 0

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.
This commit is contained in:
Torsten Dreyer 2011-06-28 12:51:00 +02:00
parent 0d900923b2
commit 279fbdc837

View file

@ -917,7 +917,7 @@ public:
virtual bool pass(FGPositioned* aPos) const { virtual bool pass(FGPositioned* aPos) const {
if (_fixes && (aPos->type() == FGPositioned::FIX)) { if (_fixes && (aPos->type() == FGPositioned::FIX)) {
// ignore fixes which end in digits - expirmental // 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; return false;
} }
} }