Commit d26fafe0 authored by Cory Quammen's avatar Cory Quammen

Added check for path length

Added check for sufficient path string length prior
to searching for "/bin" at the end of the path. This
solves exceptions thrown by a number of tests.

Change-Id: Ibefe7356a9f5b0353822258155bba706f1e26f2e
parent f2cde10d
......@@ -322,7 +322,8 @@ bool vtkInitializationHelper::LoadSettings()
std::string installDirectory = app_dir.substr(0, app_dir.find("/lib/paraview-" PARAVIEW_VERSION));
// Remove the trailing /bin if it is there.
if (installDirectory.substr(installDirectory.size()-4) == "/bin")
if (installDirectory.size() >= 4 &&
installDirectory.substr(installDirectory.size()-4) == "/bin")
{
installDirectory = installDirectory.substr(0, installDirectory.size()-4);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment