summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-10-21 13:04:50 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-10-21 13:04:50 (GMT)
commit2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd (patch)
tree3846e87badf3509da6b95f30514c05fa4054becf /Source/cmCommandArgumentParserHelper.cxx
parent713062831295f85d084cb4b337843e33034adaa4 (diff)
downloadCMake-2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd.zip
CMake-2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd.tar.gz
CMake-2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd.tar.bz2
Fix seg fault for empty ENV{} call bug #9747
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index ace67ec..234c37e 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -65,7 +65,11 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
if ( !key )
{
return this->ExpandVariable(var);
- }
+ }
+ if(!var)
+ {
+ return this->EmptyVariable;
+ }
if ( strcmp(key, "ENV") == 0 )
{
char *ptr = getenv(var);