Skip to content
Snippets Groups Projects
Commit d4e7f08e authored by Brad King's avatar Brad King
Browse files

Directory: Check opendir return value before using it

In Directory::GetNumberOfFilesInDirectory add a missing check for NULL.

Change-Id: I6946eec913e60f786a419264555ec800f9b34d38
parent b33e7b96
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
{
DIR* dir = opendir(name.c_str());
if (!dir)
{
return 0;
}
unsigned long count = 0;
for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment