From b22203212a892137e8da9501d42f58c022d61289 Mon Sep 17 00:00:00 2001 From: Ye Ting Date: Wed, 24 Sep 2014 09:35:54 +0000 Subject: [PATCH] Enhance TargetName check when save iSCSI configuration. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ye Ting Reviewed-by: Wu, Jiaxin Reviewed-by: Fu, Siyuan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16168 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/IScsiDxe/IScsiConfig.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index 1d648f78bd..c6b48c651b 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -541,7 +541,24 @@ IScsiConvertIfrNvDataToAttemptConfigData ( ); return EFI_INVALID_PARAMETER; } + + // + // Validate iSCSI target name configuration again: + // The format of iSCSI target name is already verified in IScsiFormCallback() when + // user input the name; here we only check the case user does not input the name. + // + if (Attempt->SessionConfigData.TargetName[0] == '\0') { + CreatePopUp ( + EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, + &Key, + L"iSCSI target name is NULL!", + NULL + ); + return EFI_INVALID_PARAMETER; + } } + + // // Validate the authentication info. // @@ -2355,7 +2372,7 @@ IScsiFormCallback ( &Key, L"Invalid iSCSI Name!", NULL - ); + ); } else { AsciiStrCpy (Private->Current->SessionConfigData.TargetName, IScsiName); }