]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools/VfrCompile: Add check to avoid using NULL pointer
authorDandan Bi <dandan.bi@intel.com>
Wed, 1 Nov 2017 08:11:47 +0000 (16:11 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 3 Nov 2017 04:39:45 +0000 (12:39 +0800)
commit631ffb70ebbe78b6e3f342b7ad9ab9b75f8796ae
tree6ab75ef9fd10a2754196832293cf6a095ddb927f
parent2f57de0ae12731fbf3a0cdd4dc1c981e94dc5816
BaseTools/VfrCompile: Add check to avoid using NULL pointer

Question value are stored in one specified storage, but the Data type
of the storage is not specified or there is no sub fields in the Data
type sometimes, so we need to add check before using related pointers.
Here list some NULL cases:
(1)For an efivastore which doesn't specify a data structure or a
   data type(UINT8,UINT16...)as the storage, just has VarName and
   VarSize instead, we can not get its data type before parsing
   its VarSize.

(2)For efivastore which just specifies the data type(UINT8,UINT16...)
   not a structure as the storage,this data type doesn't have sub-fields.

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