Explorar o código

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

Glen Lehmann %!s(int64=19) %!d(string=hai) anos
pai
achega
df3d4cb3c4
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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)