diff options
author | Shumin Qiu <shumin.qiu@intel.com> | 2013-12-17 01:04:38 +0000 |
---|---|---|
committer | shenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-17 01:04:38 +0000 |
commit | c6cef635326906241a0856d833836f82959b11a5 (patch) | |
tree | 397a25afc3560e80006850980faf787485d98054 /ShellPkg | |
parent | 6f05676ddd1d8bfade58d7530afa173e513c9a62 (diff) | |
download | edk2-platforms-c6cef635326906241a0856d833836f82959b11a5.tar.xz |
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
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 590dbf79e3..9e33286c90 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) {
|