// Construct configuration request string header\r
//\r
ConfigHdr = ConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, ChildHandle);\r
- Length = StrLen (ConfigHdr);\r
+ if (ConfigHdr != NULL) {\r
+ Length = StrLen (ConfigHdr);\r
+ } else {\r
+ Length = 0;\r
+ }\r
ConfigResp = AllocateZeroPool ((Length + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));\r
if (ConfigResp == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_ERROR;\r
}\r
- StrCpy (ConfigResp, ConfigHdr);\r
+ if (ConfigHdr != NULL) {\r
+ StrCpy (ConfigResp, ConfigHdr);\r
+ }\r
\r
//\r
// Append OFFSET/WIDTH pair\r
// Construct config request string header\r
//\r
ConfigHdr = ConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, ChildHandle);\r
-\r
- Length = StrLen (ConfigHdr);\r
+ if (ConfigHdr != NULL) {\r
+ Length = StrLen (ConfigHdr);\r
+ } else {\r
+ Length = 0;\r
+ }\r
ConfigResp = AllocateZeroPool ((Length + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));\r
- StrCpy (ConfigResp, ConfigHdr);\r
+ if (ConfigHdr != NULL) {\r
+ StrCpy (ConfigResp, ConfigHdr);\r
+ }\r
\r
NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);\r
if (NicConfig == NULL) {\r
ListOperation = ShellCommandLineGetFlag(Package, L"-l");\r
SetOperation = ShellCommandLineGetFlag(Package, L"-s");\r
\r
- if (ClearOperation && ListOperation \r
- ||SetOperation && ListOperation \r
- ||ClearOperation && SetOperation \r
+ if ((ClearOperation && ListOperation)\r
+ ||(SetOperation && ListOperation)\r
+ ||(ClearOperation && SetOperation)\r
) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellNetwork1HiiHandle);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r