BUG: Fix invalid array access discovered during investigation of issue #7832.
This commit is contained in:
parent
36e9a6ed81
commit
f6828c391d
|
@ -1232,7 +1232,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
|
||||||
}
|
}
|
||||||
std::string flags = includeFlags.str();
|
std::string flags = includeFlags.str();
|
||||||
// remove trailing separators
|
// 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] = ' ';
|
flags[flags.size()-1] = ' ';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue