]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFsp2Pkg/GenCfgOpt.py: Coverity scan flags issues.
authorChasel Chiu <chasel.chiu@intel.com>
Fri, 7 Feb 2020 08:33:36 +0000 (16:33 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 13 Feb 2020 09:21:22 +0000 (09:21 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1706

Issue was: invalid_operation: Invalid operation on
null-like value "Base".
Fixed it by initializing Base to 0 before entering
while loop.

Test:
Compared script output before and after this patch and
the result is identical.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
IntelFsp2Pkg/Tools/GenCfgOpt.py

index 2fa7582d857952b1eee1b7126d250d9ce62891ad..d1d6901bc3672ce62fd1d559eef22d2063290189 100644 (file)
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py\r
 #\r
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 ##\r
@@ -439,6 +439,7 @@ EndList
 \r
         MaxAlign = 32   #Default align to 32, but if there are 64 bit unit, align to 64\r
         SizeAlign = 0   #record the struct max align\r
+        Base = 0        #Starting offset of sub-structure.\r
         while len(DscLines):\r
             DscLine  = DscLines.pop(0).strip()\r
             Handle   = False\r