]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c
MdeModulePkg/Universal/FvSimpleFileSystemDxe: Use safe string functions to refine...
[mirror_edk2.git] / MdeModulePkg / Universal / FvSimpleFileSystemDxe / FvSimpleFileSystem.c
index 019be267578a506c30b85360ef5acff8b7e52fcb..b0e7dc302eb481ccd821c774958985d2cad62519 100644 (file)
@@ -12,7 +12,7 @@
   from the UEFI shell. It is entirely read-only.\r
 \r
 Copyright (c) 2014, ARM Limited. All rights reserved.\r
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -898,7 +898,11 @@ FvSimpleFileSystemGetInfo (
     FsInfoOut = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
 \r
     CopyMem (FsInfoOut, &mFsInfoTemplate, sizeof (EFI_FILE_SYSTEM_INFO));\r
-    Status = StrnCpyS (FsInfoOut->VolumeLabel, (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel)) / sizeof (CHAR16), Instance->VolumeLabel, StrLen (Instance->VolumeLabel));\r
+    Status = StrnCpyS ( FsInfoOut->VolumeLabel, \r
+                        (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel)) / sizeof (CHAR16), \r
+                        Instance->VolumeLabel, \r
+                        StrLen (Instance->VolumeLabel)\r
+                        );\r
     ASSERT_EFI_ERROR (Status);\r
     FsInfoOut->Size = Size;\r
     return Status;\r
@@ -919,7 +923,11 @@ FvSimpleFileSystemGetInfo (
     }\r
 \r
     FsVolumeLabel = (EFI_FILE_SYSTEM_VOLUME_LABEL*) Buffer;\r
-    Status        = StrnCpyS (FsVolumeLabel->VolumeLabel, (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_VOLUME_LABEL, VolumeLabel)) / sizeof (CHAR16), Instance->VolumeLabel, StrLen (Instance->VolumeLabel));\r
+    Status        = StrnCpyS (FsVolumeLabel->VolumeLabel, \r
+                              (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_VOLUME_LABEL, VolumeLabel)) / sizeof (CHAR16),\r
+                              Instance->VolumeLabel, \r
+                              StrLen (Instance->VolumeLabel)\r
+                              );\r
     ASSERT_EFI_ERROR (Status);\r
     return Status;\r
   } else {\r