BaseTools/VfrCompile: Avoid possible NULL pointer dereference

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hao Wu
2016-10-11 10:33:17 +08:00
parent d1f6eb27fe
commit 9b78c54a09
2 changed files with 16 additions and 2 deletions

View File

@@ -665,7 +665,7 @@ CVfrVarDataTypeDB::GetTypeField (
{
SVfrDataField *pField = NULL;
if ((FName == NULL) && (Type == NULL)) {
if ((FName == NULL) || (Type == NULL)) {
return VFR_RETURN_FATAL_ERROR;
}