Qiu Shumin
1970-01-01 00:00:00 UTC
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index 7687ca3..25bb8fb 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -407,7 +407,14 @@ FileHandleIsDirectory (
if (DirHandle == NULL) {
return (EFI_INVALID_PARAMETER);
}
-
+
+ //
+ // check whether the DirHandle is valid
+ //
+ if (DirHandle->Revision != EFI_FILE_PROTOCOL_LATEST_REVISION) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// get the file information for DirHandle
//
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index 7687ca3..25bb8fb 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -407,7 +407,14 @@ FileHandleIsDirectory (
if (DirHandle == NULL) {
return (EFI_INVALID_PARAMETER);
}
-
+
+ //
+ // check whether the DirHandle is valid
+ //
+ if (DirHandle->Revision != EFI_FILE_PROTOCOL_LATEST_REVISION) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// get the file information for DirHandle
//
--
1.9.5.msysgit.1
------------------------------------------------------------------------------
1.9.5.msysgit.1
------------------------------------------------------------------------------