summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-14 19:21:13 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-14 19:21:13 +0000
commit532691c8ba90e5022174503ab0781322c6f79cab (patch)
tree7c598451898c979b99cdfa0ec1573d509d5ee1ff /ShellPkg/Library/UefiShellDebug1CommandsLib
parentde2a15eebbf467c335f3e28ff0ba0ca6dd0ddcf2 (diff)
downloadedk2-platforms-532691c8ba90e5022174503ab0781322c6f79cab.tar.xz
ShellPkg: Add checking for memory allocation and pointer returns from functions.
signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12540 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c2
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c1
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c3
3 files changed, 5 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
index de2ce2bfc3..ffd05b8ba3 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
@@ -978,7 +978,7 @@ ShellCommandRunBcfg (
ShellStatus = BcfgAddDebug1(
CurrentOperation.Number1,
CurrentOperation.FileName,
- CurrentOperation.Description,
+ CurrentOperation.Description==NULL?L"":CurrentOperation.Description,
CurrentOperation.Order,
Length / sizeof(CurrentOperation.Order[0]),
CurrentOperation.Target,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
index f5fb7d262a..ff3819c6c6 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
@@ -178,6 +178,7 @@ HFileImageRead (
StatusBarSetStatusString (UnicodeBuffer);
FreePool (UnicodeBuffer);
+ return EFI_OUT_OF_RESOURCES;
}
HFileImageSetFileName (FileName);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
index 9ab5d89748..945002a2ea 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
@@ -303,6 +303,9 @@ ConvertStringToGuid (
}
TempCopy = NULL;
TempCopy = StrnCatGrow(&TempCopy, NULL, StringGuid, 0);
+ if (TempCopy == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
Walker = TempCopy;
TempSpot = StrStr(Walker, L"-");
if (TempSpot != NULL) {