]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools/VrfCompile: Fix uninitialized field from unnamed field
authorMichael D Kinney <michael.d.kinney@intel.com>
Mon, 4 Oct 2021 23:04:41 +0000 (16:04 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 3 Nov 2021 23:43:46 +0000 (23:43 +0000)
commitb258f12889c09555e99c9cebf56dba45190c5dc2
tree9f973f0eb3d3ddfaaef12ceca66cd81be72d98d6
parent6f9e83f757ed7c5c78d071f475b2e72d899c2aef
BaseTools/VrfCompile: Fix uninitialized field from unnamed field

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3687

If a C structure parsed by the VFR compiler contains an unnamed
field, then mFieldName is left uninitialized, which generates
random data in the VFR compiler output file.

If the FieldName is NULL, then initialize pNewField->mFieldName
to a Null-terminated empty string.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp