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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user