]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
ShellPkg: Use safe string functions to refine code.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Edit / FileBuffer.c
index ed23365363cb5191e5e37394af6da42b76cc2fc4..acd8512ff3e876e4318c4f50c5ff79092932e577 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implements filebuffer interface functions.\r
 \r
-  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -507,7 +507,7 @@ FileBufferPrintLine (
   PrintLine = AllocatePool (BufLen);\r
   ASSERT (PrintLine != NULL);\r
 \r
-  StrnCpy (PrintLine, Buffer, MIN(Limit, MainEditor.ScreenSize.Column));\r
+  StrnCpyS (PrintLine, BufLen/sizeof(CHAR16), Buffer, MIN(Limit, MainEditor.ScreenSize.Column));\r
   for (; Limit < MainEditor.ScreenSize.Column; Limit++) {\r
     PrintLine[Limit] = L' ';\r
   }\r