diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-21 13:04:50 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-21 13:04:50 (GMT) |
commit | 2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd (patch) | |
tree | 3846e87badf3509da6b95f30514c05fa4054becf /Source/cmCommandArgumentParserHelper.cxx | |
parent | 713062831295f85d084cb4b337843e33034adaa4 (diff) | |
download | CMake-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.cxx | 6 |
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); |