summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShumin Qiu <shumin.qiu@intel.com>2013-12-17 01:04:38 +0000
committershenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-17 01:04:38 +0000
commitc6cef635326906241a0856d833836f82959b11a5 (patch)
tree397a25afc3560e80006850980faf787485d98054
parent6f05676ddd1d8bfade58d7530afa173e513c9a62 (diff)
downloadedk2-c6cef635326906241a0856d833836f82959b11a5.zip
edk2-c6cef635326906241a0856d833836f82959b11a5.tar.gz
edk2-c6cef635326906241a0856d833836f82959b11a5.tar.bz2
Update code to ensure the pointer ‘CurrentName’ in function ‘PerformSingleMappingDisplay’ isn’t null before being processed.
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14990 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
index 590dbf7..9e33286 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
@@ -468,6 +468,9 @@ PerformSingleMappingDisplay(
}
} else {
Alias = StrnCatGrow(&Alias, 0, MapList, 0);
+ if (Alias == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
TempSpot = StrStr(Alias, CurrentName);
if (TempSpot != NULL) {
TempSpot2 = StrStr(TempSpot, L";");
@@ -484,6 +487,10 @@ PerformSingleMappingDisplay(
}
} else {
CurrentName = NULL;
+ CurrentName = StrnCatGrow(&CurrentName, 0, L"", 0);
+ if (CurrentName == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
}
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
if (!SFO) {