Browse Source

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

Glen Lehmann 19 năm trước cách đây
mục cha
commit
df3d4cb3c4
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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)