mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
BUG: Fix invalid array access discovered during investigation of issue #7832.
This commit is contained in:
@@ -1232,7 +1232,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
|
||||
}
|
||||
std::string flags = includeFlags.str();
|
||||
// remove trailing separators
|
||||
if((sep[0] != ' ') && flags[flags.size()-1] == sep[0])
|
||||
if((sep[0] != ' ') && flags.size()>0 && flags[flags.size()-1] == sep[0])
|
||||
{
|
||||
flags[flags.size()-1] = ' ';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user