summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c')
-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);
}