From b9679cd7458110573dd4614148433312b61a1e26 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Wed, 15 Jun 2016 13:38:03 +0800 Subject: NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao Cc: Siyuan Fu Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jaben Carsey Reviewed-by: Jiaxin Wu Reviewed-by: Siyuan Fu --- NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'NetworkPkg/Application') diff --git a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c index 9bbc11490c..06eb30c091 100644 --- a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c +++ b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c @@ -271,7 +271,7 @@ CreateSpdEntry ( // ValueStr = ShellCommandLineGetValue (ParamPackage, L"--name"); if (ValueStr != NULL) { - UnicodeStrToAsciiStr (ValueStr, (CHAR8 *) (*Data)->Name); + UnicodeStrToAsciiStrS (ValueStr, (CHAR8 *) (*Data)->Name, sizeof ((*Data)->Name)); *Mask |= NAME; } @@ -785,7 +785,7 @@ CreateSadEntry ( (*Data)->AlgoInfo.EspAlgoInfo.EncKeyLength = EncKeyLength; AsciiStr = AllocateZeroPool (EncKeyLength + 1); ASSERT (AsciiStr != NULL); - UnicodeStrToAsciiStr (ValueStr, AsciiStr); + UnicodeStrToAsciiStrS (ValueStr, AsciiStr, EncKeyLength + 1); CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.EncKey, AsciiStr, EncKeyLength); FreePool (AsciiStr); *Mask |= ENCRYPT_KEY; @@ -815,7 +815,7 @@ CreateSadEntry ( (*Data)->AlgoInfo.EspAlgoInfo.AuthKeyLength = AuthKeyLength; AsciiStr = AllocateZeroPool (AuthKeyLength + 1); ASSERT (AsciiStr != NULL); - UnicodeStrToAsciiStr (ValueStr, AsciiStr); + UnicodeStrToAsciiStrS (ValueStr, AsciiStr, AuthKeyLength + 1); CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.AuthKey, AsciiStr, AuthKeyLength); FreePool (AsciiStr); *Mask |= AUTH_KEY; -- cgit v1.2.3