From 1c9e1c3a8b644c3e46fe285fa964e3eb4f084147 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 21 May 2004 20:06:09 +0000 Subject: [PATCH] - Fixed a bug in IsoSearchDirectoryBufferForFile. Compare the offset first, so we don't access invalid memory. svn path=/trunk/; revision=9456 --- freeldr/freeldr/fs/iso.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)); }