Browse Source

BUG: #3563. Segmentation fault with non initialized input or NULL pointers.

Glen Lehmann 19 years ago
parent
commit
df3d4cb3c4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Source/kwsys/Directory.cxx

+ 5 - 0
Source/kwsys/Directory.cxx

@@ -199,6 +199,11 @@ namespace KWSYS_NAMESPACE
 bool Directory::Load(const char* name)
 {
   this->Clear();
+   
+  if (!name)
+    {
+    return 0;
+    }
   DIR* dir = opendir(name);
 
   if (!dir)