Skip to content

Commit

Permalink
Always use a wildcard in NTOpenDirectory.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed May 17, 2021
1 parent 8533847 commit 8305ee3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions magick/nt-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1752,23 +1752,16 @@ MagickPrivate DIR *NTOpenDirectory(const char *path)
MaxTextExtent);
if (length == 0)
return((DIR *) NULL);
if(wcsncat(file_specification,L"\\*.*",MaxTextExtent-wcslen(
file_specification)-1) == (wchar_t*) NULL)
return((DIR *) NULL);
entry=(DIR *) AcquireCriticalMemory(sizeof(DIR));
entry->firsttime=TRUE;
entry->hSearch=FindFirstFileW(file_specification,&entry->Win32FindData);
if (entry->hSearch == INVALID_HANDLE_VALUE)
{
if(wcsncat(file_specification,L"\\*.*",MaxTextExtent-wcslen(
file_specification)-1) == (wchar_t*) NULL)
{
entry=(DIR *) RelinquishMagickMemory(entry);
return((DIR *) NULL);
}
entry->hSearch=FindFirstFileW(file_specification,&entry->Win32FindData);
if (entry->hSearch == INVALID_HANDLE_VALUE)
{
entry=(DIR *) RelinquishMagickMemory(entry);
return((DIR *) NULL);
}
entry=(DIR *) RelinquishMagickMemory(entry);
return((DIR *) NULL);
}
return(entry);
}
Expand Down

0 comments on commit 8305ee3

Please sign in to comment.