]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c
ShellPkg/Dp: Add null pointer check
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Vol.c
index 0bf0dd0ad5c924be36304b69aaff7f01cc79039c..f911c7eae86d57cdd20d8b348d2335cb242ad63b 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Main file for vol shell level 2 function.\r
 \r
-  Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<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
@@ -27,7 +27,6 @@
   @retval SHELL_SUCCESS     The operation was sucessful.\r
 **/\r
 SHELL_STATUS\r
-EFIAPI\r
 HandleVol(\r
   IN CONST CHAR16  *Path,\r
   IN CONST BOOLEAN Delete,\r
@@ -120,7 +119,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