From b08657cf0fbe2d02d87a866e7c2dfc29f8d80571 Mon Sep 17 00:00:00 2001
From: David Cole <david.cole@kitware.com>
Date: Thu, 27 Jan 2011 06:57:12 -0500
Subject: Xcode: Fix crash: avoid strlen call on NULL char *
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Thanks to Johan Björk for the report on the CMake mailing list.
---
 Source/cmGlobalXCodeGenerator.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 1395865..358721f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2693,7 +2693,7 @@ void cmGlobalXCodeGenerator
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   const char* osxArch =
       this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES");
-  if(strlen(osxArch) == 0)
+  if(!osxArch || strlen(osxArch) == 0)
     {
     if(this->XcodeVersion >= 32)
       {
-- 
cgit v0.12