Revision: 17851
          http://sourceforge.net/p/edk2/code/17851
Author:   hwu1225
Date:     2015-07-07 06:13:53 +0000 (Tue, 07 Jul 2015)
Log Message:
-----------
IntelFrameworkModulePkg GenericBdsLib: Resolve array size mismatch

Match the size of array GaugeString defined in function
WriteBootToOsPerformanceData() with the size of field 'Token' defined in
struct PERF_DATA in MdeModulePkg\Include\Guid\Performance.h.

Doing so will ensure the size consistency when doing StrCpyS() between
PERF_DATA.Token and GaugeString (like here in Performance.c).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c

Modified: trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c      
2015-07-07 05:47:08 UTC (rev 17850)
+++ trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c      
2015-07-07 06:13:53 UTC (rev 17851)
@@ -40,7 +40,7 @@
   UINTN EndIndex;
 
   if (PdbFileName == NULL) {
-    AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");
+    AsciiStrCpyS (GaugeString, PERF_TOKEN_SIZE, " ");
   } else {
     StartIndex = 0;
     for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)
@@ -60,7 +60,7 @@
     for (Index = StartIndex; Index < EndIndex; Index++) {
       GaugeString[Index1] = PdbFileName[Index];
       Index1++;
-      if (Index1 == PERF_TOKEN_LENGTH - 1) {
+      if (Index1 == PERF_TOKEN_LENGTH) {
         break;
       }
     }
@@ -91,7 +91,7 @@
   CHAR8                       *PdbFileName;
   EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
 
-  AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");
+  AsciiStrCpyS (GaugeString, PERF_TOKEN_SIZE, " ");
 
   //
   // Get handle name from image protocol
@@ -153,7 +153,7 @@
   UINT32                    LimitCount;
   EFI_HANDLE                *Handles;
   UINTN                     NoHandles;
-  CHAR8                     GaugeString[PERF_TOKEN_LENGTH];
+  CHAR8                     GaugeString[PERF_TOKEN_SIZE];
   UINT8                     *Ptr;
   UINT32                    Index;
   UINT64                    Ticker;


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to