NetworkPkg: Add check logic for iSCSI driver.

Need to check variable of mPrivate whether is
null before used and redefine the array length
of target address for keyword.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
(cherry picked from commit b28bf4143d)
This commit is contained in:
Zhang, Lubo
2017-04-06 16:57:41 +08:00
committed by Jiaxin Wu
parent b4221a2e9e
commit d7c94fca2f
2 changed files with 16 additions and 16 deletions

View File

@@ -744,24 +744,24 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
}
}
CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, ATTEMPT_NAME_LIST_SIZE);
}
NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
IScsiMacAddrToStr (
&NicInfo->PermanentAddress,
NicInfo->HwAddressSize,
NicInfo->VlanId,
MacString
);
CopyMem (
IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
MacString,
StrLen (MacString) * sizeof (CHAR16)
NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
IScsiMacAddrToStr (
&NicInfo->PermanentAddress,
NicInfo->HwAddressSize,
NicInfo->VlanId,
MacString
);
CopyMem (
IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
MacString,
StrLen (MacString) * sizeof (CHAR16)
);
*(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
}
*(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
}
}
}
/**