diff options
author | Zhang, Lubo <lubo.zhang@intel.com> | 2017-04-06 16:57:41 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:22 +0800 |
commit | 57a6b0612a37a0564e755dcafdb436f6a763448f (patch) | |
tree | 3491b2e1f8253d5c2c0d81aaaf231ed5ba33a3a2 | |
parent | 2fce451ff7b72ed06e771d1159e9e87ec1a2e578 (diff) | |
download | edk2-platforms-57a6b0612a37a0564e755dcafdb436f6a763448f.tar.xz |
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 b28bf4143d00142323d5dd9a9129b9b25d0dff56)
-rw-r--r-- | Core/NetworkPkg/IScsiDxe/IScsiConfig.c | 30 | ||||
-rw-r--r-- | Core/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/Core/NetworkPkg/IScsiDxe/IScsiConfig.c b/Core/NetworkPkg/IScsiDxe/IScsiConfig.c index 56a8685c2c..a588403017 100644 --- a/Core/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/Core/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/Core/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h b/Core/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h index f89f320854..22119ad338 100644 --- a/Core/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h +++ b/Core/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];
|