audk/MdePkg
Michael Kubacki 321240b135 MdePkg: Fix conditionally uninitialized variables
Fixes CodeQL alerts for CWE-457:
https://cwe.mitre.org/data/definitions/457.html

Note that this change affects the actual return value from the
following functions. The functions documented that if an integer
overflow occurred, MAX_UINTN would be returned. They were
implemented to actually return an undefined value from the stack.

This change makes the function follow its description. However, this
is technically different than what callers may have previously
expected.

MdePkg/Library/BaseLib/String.c:
  - StrDecimalToUintn()
  - StrDecimalToUint64()
  - StrHexToUintn()
  - StrHexToUint64()
  - AsciiStrDecimalToUintn()
  - AsciiStrDecimalToUint64()
  - AsciiStrHexToUintn()
  - AsciiStrHexToUint64()

Cc: Erich McMillan <emcmillan@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Co-authored-by: Erich McMillan <emcmillan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2023-04-03 15:29:08 +00:00
..
Include MdePkg/Base.h: Introduce various alignment-related macros 2023-04-01 23:11:44 +00:00
Library MdePkg: Fix conditionally uninitialized variables 2023-04-03 15:29:08 +00:00
Test MdePkg/Test: Add port of BaseSafeIntLib unit tests to GoogleTest 2022-11-11 05:46:51 +00:00
MdeLibs.dsc.inc MdePkg/ArmTrngLib: Add NULL instance of Arm TRNG Library 2022-11-06 16:32:28 +00:00
MdePkg.ci.yaml MdePkg: Add Acpi65.h to IgnoreFiles area 2023-01-31 02:27:58 +00:00
MdePkg.dec MdePkg/Include: Add IPMI KCS definitions 2023-03-26 18:15:27 +00:00
MdePkg.dsc MdePkg: Add BaseRiscVSbiLib Library for RISC-V 2023-02-16 05:53:28 +00:00
MdePkg.uni MdePkg: Add PcdSpeculationBarrierType 2019-04-30 16:39:09 -07:00
MdePkgExtra.uni MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00