[edk2] [PATCH 15/17] BaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'

Hao Wu posted 17 patches 7 years ago
[edk2] [PATCH 15/17] BaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'
Posted by Hao Wu 7 years ago
As a workaround for the static code checkers, enlarge the size of the
string buffer 'AlignmentBuffer' so that it can hold all the digits of an
unsigned 32-bit integer plus the size unit character (e.g. 'M' & 'K').

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 BaseTools/Source/C/GenFfs/GenFfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs/GenFfs.c
index 3b4a9b7761..eb40c30ea7 100644
--- a/BaseTools/Source/C/GenFfs/GenFfs.c
+++ b/BaseTools/Source/C/GenFfs/GenFfs.c
@@ -606,7 +606,12 @@ Returns:
   UINT8                   PeSectionNum;
   UINT32                  HeaderSize;
   UINT32                  Alignment;
-  CHAR8                   AlignmentBuffer[8];
+  //
+  // Workaround for static code checkers.
+  // Ensures the size of 'AlignmentBuffer' can hold all the digits of an
+  // unsigned 32-bit integer plus the size unit character.
+  //
+  CHAR8                   AlignmentBuffer[16];
   
   //
   // Init local variables
-- 
2.12.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel