Revision: 17785
          http://sourceforge.net/p/edk2/code/17785
Author:   shenshushi
Date:     2015-07-01 08:25:33 +0000 (Wed, 01 Jul 2015)
Log Message:
-----------
MdeModulePkg/Universal/FvSimpleFileSystemDxe: Use safe string functions to 
refine code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin....@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu...@intel.com>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c

Modified: 
trunk/edk2/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c
===================================================================
--- 
trunk/edk2/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c    
    2015-07-01 08:23:30 UTC (rev 17784)
+++ 
trunk/edk2/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c    
    2015-07-01 08:25:33 UTC (rev 17785)
@@ -12,7 +12,7 @@
   from the UEFI shell. It is entirely read-only.
 
 Copyright (c) 2014, ARM Limited. All rights reserved.
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -898,7 +898,11 @@
     FsInfoOut = (EFI_FILE_SYSTEM_INFO *) Buffer;
 
     CopyMem (FsInfoOut, &mFsInfoTemplate, sizeof (EFI_FILE_SYSTEM_INFO));
-    Status = StrnCpyS (FsInfoOut->VolumeLabel, (*BufferSize - OFFSET_OF 
(EFI_FILE_SYSTEM_INFO, VolumeLabel)) / sizeof (CHAR16), Instance->VolumeLabel, 
StrLen (Instance->VolumeLabel));
+    Status = StrnCpyS ( FsInfoOut->VolumeLabel, 
+                        (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_INFO, 
VolumeLabel)) / sizeof (CHAR16), 
+                        Instance->VolumeLabel, 
+                        StrLen (Instance->VolumeLabel)
+                        );
     ASSERT_EFI_ERROR (Status);
     FsInfoOut->Size = Size;
     return Status;
@@ -919,7 +923,11 @@
     }
 
     FsVolumeLabel = (EFI_FILE_SYSTEM_VOLUME_LABEL*) Buffer;
-    Status        = StrnCpyS (FsVolumeLabel->VolumeLabel, (*BufferSize - 
OFFSET_OF (EFI_FILE_SYSTEM_VOLUME_LABEL, VolumeLabel)) / sizeof (CHAR16), 
Instance->VolumeLabel, StrLen (Instance->VolumeLabel));
+    Status        = StrnCpyS (FsVolumeLabel->VolumeLabel, 
+                              (*BufferSize - OFFSET_OF 
(EFI_FILE_SYSTEM_VOLUME_LABEL, VolumeLabel)) / sizeof (CHAR16),
+                              Instance->VolumeLabel, 
+                              StrLen (Instance->VolumeLabel)
+                              );
     ASSERT_EFI_ERROR (Status);
     return Status;
   } else {


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to