From 2232bd5ee58b8f933fb4ea1013c37fde317e875d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 1 Jul 2009 15:39:06 +0000 Subject: [PATCH] From Byran Thrall, "The OpenFlight plugin doesn't handle unrecognized options or extra whitespace in all cases, causing it to crash." --- src/osgPlugins/OpenFlight/ExportOptions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osgPlugins/OpenFlight/ExportOptions.cpp b/src/osgPlugins/OpenFlight/ExportOptions.cpp index 2fb664ac7..80c278c5c 100644 --- a/src/osgPlugins/OpenFlight/ExportOptions.cpp +++ b/src/osgPlugins/OpenFlight/ExportOptions.cpp @@ -163,6 +163,12 @@ ExportOptions::parseOptionsString() setStripTextureFilePath( true ); continue; } + // Protect against unrecognized options without values + if ( pos == str.npos ) + { + osg::notify( osg::WARN ) << "fltexp: Bogus OptionString: " << token << std::endl; + continue; + } // Not a Boolean/toggle. Must have a value. // Get the value of the token, which could be double-quoted.