summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-23 01:26:06 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-23 01:26:06 +0000
commit72c8a89a653a6d393969d928b18fde86cf021901 (patch)
tree4d5e409e41ec99277ccea1e804c5b68798f76f01 /ShellPkg
parent1ef41207dc5fe92acb63dc0e4d0e4d9fab2ff3d9 (diff)
downloadedk2-platforms-72c8a89a653a6d393969d928b18fde86cf021901.tar.xz
Add check code to avoid access violation.
Signed-off-by: ydong10 Reviewed-by: jcarsey git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11873 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
index 5203f11f9b..1b6b189f25 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
@@ -64,6 +64,10 @@ FindHiiHandleViaDevPath(
return (Status);
}
+ if (HandleBuffer == NULL) {
+ return EFI_NOT_FOUND;
+ }
+
for (LoopVariable = 0 ; LoopVariable < (HandleBufferSize/sizeof(HandleBuffer[0])) && *HiiHandle == NULL ; LoopVariable++) {
MainBufferSize = 0;
MainBuffer = NULL;