Revision: 19229
http://sourceforge.net/p/edk2/code/19229
Author: shenshushi
Date: 2015-12-13 08:44:49 +0000 (Sun, 13 Dec 2015)
Log Message:
-----------
ShellPkg: Initialize the local pointer to avoid potential suspicious
dereference.
1. Initialize the local pointer 'HandleBuffer'.
2. When 'LocateHandleBuffer' return error 'HandleBuffer' is expected unchanged,
add code make sure this.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Ruiyu Ni <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
Modified: trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c 2015-12-12
19:28:21 UTC (rev 19228)
+++ trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c 2015-12-13
08:44:49 UTC (rev 19229)
@@ -317,6 +317,7 @@
}
*PciRootBridgeIo = NULL;
+ HandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiPciRootBridgeIoProtocolGuid,
@@ -324,7 +325,7 @@
&HandleCount,
&HandleBuffer
);
- if (EFI_ERROR (Status) || (HandleCount == 0)) {
+ if (EFI_ERROR (Status) || (HandleCount == 0) || (HandleBuffer == NULL)) {
return FALSE;
}
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits