]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / PolicyEntryOperation.c
index 9bbc11490c5430cfb883c9c444b99e6414235a59..06eb30c091c957eba788c12f5fe68a973ec82358 100644 (file)
@@ -271,7 +271,7 @@ CreateSpdEntry (
   //\r
   ValueStr = ShellCommandLineGetValue (ParamPackage, L"--name");\r
   if (ValueStr != NULL) {\r
-    UnicodeStrToAsciiStr (ValueStr, (CHAR8 *) (*Data)->Name);\r
+    UnicodeStrToAsciiStrS (ValueStr, (CHAR8 *) (*Data)->Name, sizeof ((*Data)->Name));\r
     *Mask |= NAME;\r
   }\r
 \r
@@ -785,7 +785,7 @@ CreateSadEntry (
     (*Data)->AlgoInfo.EspAlgoInfo.EncKeyLength = EncKeyLength;\r
     AsciiStr = AllocateZeroPool (EncKeyLength + 1);\r
     ASSERT (AsciiStr != NULL);\r
-    UnicodeStrToAsciiStr (ValueStr, AsciiStr);\r
+    UnicodeStrToAsciiStrS (ValueStr, AsciiStr, EncKeyLength + 1);\r
     CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.EncKey,  AsciiStr, EncKeyLength);\r
     FreePool (AsciiStr);\r
     *Mask |= ENCRYPT_KEY;\r
@@ -815,7 +815,7 @@ CreateSadEntry (
     (*Data)->AlgoInfo.EspAlgoInfo.AuthKeyLength = AuthKeyLength;\r
     AsciiStr = AllocateZeroPool (AuthKeyLength + 1);\r
     ASSERT (AsciiStr != NULL);\r
-    UnicodeStrToAsciiStr (ValueStr, AsciiStr);\r
+    UnicodeStrToAsciiStrS (ValueStr, AsciiStr, AuthKeyLength + 1);\r
     CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.AuthKey, AsciiStr, AuthKeyLength);\r
     FreePool (AsciiStr);\r
     *Mask |= AUTH_KEY;\r