]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellParametersProtocol.c
ShellPkg: Use safe string functions to refine code.
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellParametersProtocol.c
index 00b413e90b4d136f64125c3bce9cb1489a0256d3..de29c25ae8352ec89a6bdbffa57b0b339614376f 100644 (file)
@@ -125,7 +125,7 @@ DEBUG_CODE_END();
     return (EFI_NOT_FOUND);\r
   }\r
 \r
-  StrnCpy(*TempParameter, (*Walker), NextDelim - *Walker);\r
+  StrnCpyS(*TempParameter, Length, (*Walker), NextDelim - *Walker);\r
 \r
   //\r
   // Add a CHAR_NULL if we didnt get one via the copy\r
@@ -1012,7 +1012,7 @@ UpdateStdInStdOutStdErr(
   //\r
   // re-populate the string to support any filenames that were in quotes.\r
   //\r
-  StrnCpy(CommandLineCopy, NewCommandLine, StrLen(NewCommandLine));\r
+  StrnCpyS(CommandLineCopy, StrSize(CommandLineCopy)/sizeof(CHAR16), NewCommandLine, StrLen(NewCommandLine));\r
 \r
   if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy)\r
     && ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine))\r