]> git.proxmox.com Git - mirror_edk2.git/commit - BaseTools/Source/C/VfrCompile/VfrSyntax.g
BaseTools/VfrCompile: Avoid using uninitialized pointer
authorBi, Dandan <dandan.bi@intel.com>
Wed, 9 May 2018 05:02:11 +0000 (13:02 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 9 May 2018 08:30:36 +0000 (16:30 +0800)
commit13e3f8c03339ebc8cd25c454fca1abde098fe7ed
tree7302429bca3316551e6136ad293af1cd3a849982
parente91797885aee58ae65d7935332e580dc8517e8f6
BaseTools/VfrCompile: Avoid using uninitialized pointer

V2:
Add function _INIT_OPHDR_COND () for variable initialization.
Make code logic more clean.

Previously _CLEAR_SAVED_OPHDR () is used for variable
initialization, and we updated it to clean memory.
But _CLEAR_SAVED_OPHDR () is still called for variable
initialization. This will cause uninitialized pointer
will be checked to free and cause unexpected issue.

This patch is to add new function for variable initialization
and keep _CLEAR_SAVED_OPHDR () to clean memory which is
aligned with its function name.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Gary Lin <glin@suse.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
BaseTools/Source/C/VfrCompile/VfrSyntax.g