]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c
ShellPkg: Use safe string functions to refine code.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Vol.c
index 39b8ad9ec8c86eaa0fc9de1e36b0e45789dba909..a6f0296d760363a511f4d35261ed2c9a9c9e81ac 100644 (file)
@@ -2,7 +2,7 @@
   Main file for vol shell level 2 function.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 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
@@ -120,7 +120,10 @@ HandleVol(
       } \r
     }\r
     if (SysInfo != NULL) {\r
-      StrnCpy ((CHAR16 *) SysInfo->VolumeLabel, Name, (Size1 > Size2?Size1/sizeof(CHAR16):Size2/sizeof(CHAR16))-1);\r
+      StrCpyS ( (CHAR16 *) SysInfo->VolumeLabel, \r
+                  (Size1>Size2? Size1/sizeof(CHAR16) : Size2/sizeof(CHAR16)), \r
+                  Name\r
+                  );\r
       SysInfo->Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + Size1;\r
       Status = EfiFpHandle->SetInfo(\r
         EfiFpHandle,\r