From f6828c391deb8274de43270fec640d02b15778fd Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 7 Apr 2009 15:13:07 -0400 Subject: [PATCH] BUG: Fix invalid array access discovered during investigation of issue #7832. --- Source/cmLocalGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c1c80a041..c38bedd6b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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] = ' '; }