From c6cef635326906241a0856d833836f82959b11a5 Mon Sep 17 00:00:00 2001 From: Shumin Qiu Date: Tue, 17 Dec 2013 01:04:38 +0000 Subject: =?UTF-8?q?Update=20code=20to=20ensure=20the=20pointer=20=E2=80=98?= =?UTF-8?q?CurrentName=E2=80=99=20in=20function=20=E2=80=98PerformSingleMa?= =?UTF-8?q?ppingDisplay=E2=80=99=20isn=E2=80=99t=20null=20before=20being?= =?UTF-8?q?=20processed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Shumin Qiu Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14990 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib') 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) { -- cgit v1.2.3