summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorZhang, Lubo <lubo.zhang@intel.com>2017-04-06 16:57:41 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-04-20 15:52:20 +0800
commitb28bf4143d00142323d5dd9a9129b9b25d0dff56 (patch)
tree2a014e236be097732bb85cdd837d1e362acf91ce /NetworkPkg
parent861c8dff2f506d602f8612ace12d244c29e63f31 (diff)
downloadedk2-b28bf4143d00142323d5dd9a9129b9b25d0dff56.tar.gz
edk2-b28bf4143d00142323d5dd9a9129b9b25d0dff56.tar.bz2
edk2-b28bf4143d00142323d5dd9a9129b9b25d0dff56.zip
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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiConfig.c30
-rw-r--r--NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h2
2 files changed, 16 insertions, 16 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 56a8685c2c..a588403017 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -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'/';
+ }
+ }
}
/**
diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
index f89f320854..22119ad338 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
+++ b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
@@ -162,7 +162,7 @@ typedef struct {
CHAR16 ISCSIInitiatorNetmask[IP4_STR_MAX_SIZE];
CHAR16 ISCSIInitiatorGateway[IP4_STR_MAX_SIZE];
CHAR16 ISCSITargetName[ISCSI_NAME_MAX_SIZE];
- CHAR16 ISCSITargetIpAddress[IP_STR_MAX_SIZE];
+ CHAR16 ISCSITargetIpAddress[ISCSI_TARGET_URI_MAX_SIZE];
CHAR16 ISCSILun[ISCSI_LUN_STR_MAX_LEN];
CHAR16 ISCSIChapUsername[ISCSI_CHAP_NAME_STORAGE];
CHAR16 ISCSIChapSecret[ISCSI_CHAP_SECRET_STORAGE];