summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellNetwork1CommandsLib
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-01 22:16:01 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-01 22:16:01 +0000
commitae724571beb0cff6edefe42942b7cdc7aa81ee94 (patch)
treeaebe447e031e49a703e77503dec70dcaf46bed30 /ShellPkg/Library/UefiShellNetwork1CommandsLib
parent5f2915f59380777728344bbbca587d4944f19ed0 (diff)
downloadedk2-platforms-ae724571beb0cff6edefe42942b7cdc7aa81ee94.tar.xz
Comment's added and fixed.
Pointer's checked for NULL before access and after memory allocations. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11499 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellNetwork1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index 3bfdf847de..d4326448f6 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -781,9 +781,14 @@ IfconfigSetNicAddrByHii (
if (ConfigHdr != NULL) {
Length = StrLen (ConfigHdr);
} else {
- Length = 0;
+ ShellStatus = SHELL_OUT_OF_RESOURCES;
+ goto ON_EXIT;
}
ConfigResp = AllocateZeroPool ((Length + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));
+ if (ConfigResp == NULL) {
+ ShellStatus = SHELL_OUT_OF_RESOURCES;
+ goto ON_EXIT;
+ }
if (ConfigHdr != NULL) {
StrCpy (ConfigResp, ConfigHdr);
}