diff --git a/freeldr/freeldr/fs/iso.c b/freeldr/freeldr/fs/iso.c index 635ed45058b..073ef450d3b 100644 --- a/freeldr/freeldr/fs/iso.c +++ b/freeldr/freeldr/fs/iso.c @@ -88,6 +88,9 @@ static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, U32 Directory Record = (PDIR_RECORD)(DirectoryBuffer + Offset); } + if (Offset >= DirectoryLength) + return FALSE; + if (Record->FileIdLength == 1 && Record->FileId[0] == 0) { DbgPrint((DPRINT_FILESYSTEM, "Name '.'\n")); @@ -115,9 +118,6 @@ static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, U32 Directory } - if (Offset >= DirectoryLength) - return FALSE; - RtlZeroMemory(Name, 32 * sizeof(UCHAR)); }