Added check under Windows for a concatinated path that exceeds the MAX_PATH so that it isn't used for file IO operations that could lead to undefined behavior
https://github.com/openscenegraph/OpenSceneGraph/issues/634
This commit is contained in:
parent
c4100174a8
commit
bea8cd6884
@ -342,6 +342,11 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
|
|||||||
OSG_DEBUG << "itr='" <<*itr<< "'\n";
|
OSG_DEBUG << "itr='" <<*itr<< "'\n";
|
||||||
std::string path = itr->empty() ? filename : concatPaths(*itr, filename);
|
std::string path = itr->empty() ? filename : concatPaths(*itr, filename);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
// if combined file path exceeds MAX_PATH then ignore as it's not a legal path otherwise subsequent IO calls with this path may result in undefined behavior
|
||||||
|
if (path.length()>MAX_PATH) continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
path = getRealPath(path);
|
path = getRealPath(path);
|
||||||
|
|
||||||
OSG_DEBUG << "FindFileInPath() : trying " << path << " ...\n";
|
OSG_DEBUG << "FindFileInPath() : trying " << path << " ...\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user