// 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