Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
---
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
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel