From 4da9ccc9e26c7e74d10425b46eae005dc0ecbf24 Mon Sep 17 00:00:00 2001 From: tye1 Date: Thu, 21 Apr 2011 09:59:53 +0000 Subject: [PATCH] Fix issue that iscsi initiator name with 223 bytes can not be saved. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11577 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 9155864e4c..fa8f202b6a 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -473,7 +473,7 @@ IScsiFormExtractConfig ( ) { EFI_STATUS Status; - CHAR8 InitiatorName[ISCSI_NAME_IFR_MAX_SIZE]; + CHAR8 InitiatorName[ISCSI_NAME_MAX_SIZE]; UINTN BufferSize; ISCSI_CONFIG_IFR_NVDATA *IfrNvData; ISCSI_FORM_CALLBACK_INFO *Private; @@ -512,7 +512,7 @@ IScsiFormExtractConfig ( IScsiConvertDeviceConfigDataToIfrNvData (Private->Current, IfrNvData); } - BufferSize = ISCSI_NAME_IFR_MAX_SIZE; + BufferSize = ISCSI_NAME_MAX_SIZE; Status = gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSize, InitiatorName); if (EFI_ERROR (Status)) { IfrNvData->InitiatorName[0] = L'\0'; @@ -666,7 +666,7 @@ IScsiFormCallback ( { ISCSI_FORM_CALLBACK_INFO *Private; UINTN BufferSize; - CHAR8 IScsiName[ISCSI_NAME_IFR_MAX_SIZE]; + CHAR8 IScsiName[ISCSI_NAME_MAX_SIZE]; CHAR16 PortString[128]; CHAR8 Ip4String[IP4_STR_MAX_SIZE]; CHAR8 LunString[ISCSI_LUN_STR_MAX_LEN]; @@ -704,7 +704,7 @@ IScsiFormCallback ( switch (QuestionId) { case KEY_INITIATOR_NAME: IScsiUnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName); - BufferSize = AsciiStrLen (IScsiName) + 1; + BufferSize = AsciiStrSize (IScsiName); Status = gIScsiInitiatorName.Set (&gIScsiInitiatorName, &BufferSize, IScsiName); if (EFI_ERROR (Status)) {