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
This commit is contained in:
ydong10 2011-06-23 01:26:06 +00:00
parent 1ef41207dc
commit 72c8a89a65
1 changed files with 4 additions and 0 deletions

View File

@ -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;