summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDriver1CommandsLib
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 01:44:03 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 01:44:03 +0000
commitcd8462ea9d8aa0edb8116c43fd26918f8e155c31 (patch)
treeb1316190f3be66143bff25f7e1c3add4ea0afa37 /ShellPkg/Library/UefiShellDriver1CommandsLib
parentbf276b45b8613a7b84d8ad7a68182863364cca0a (diff)
downloadedk2-platforms-cd8462ea9d8aa0edb8116c43fd26918f8e155c31.tar.xz
Check the buffer allocation result before using it.
Signed-off-by:ydong10 Reviewed-by:jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11811 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
index bd5a825ad4..5203f11f9b 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
@@ -56,6 +56,7 @@ FindHiiHandleViaDevPath(
Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
HandleBuffer = AllocateZeroPool(HandleBufferSize);
+ ASSERT (HandleBuffer != NULL);
Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
}
if (EFI_ERROR(Status)) {
@@ -69,6 +70,7 @@ FindHiiHandleViaDevPath(
Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
MainBuffer = AllocateZeroPool(MainBufferSize);
+ ASSERT (MainBuffer != NULL);
Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
}
//