BaseTools/GenFv: Avoid possible NULL pointer dereference
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file contains the internal functions required to generate a Firmware Volume.
|
This file contains the internal functions required to generate a Firmware Volume.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
|
Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
|
||||||
Portions Copyright (c) 2016 HP Development Company, L.P.<BR>
|
Portions Copyright (c) 2016 HP Development Company, L.P.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
@ -2494,6 +2494,10 @@ Returns:
|
|||||||
// Open the FV Extension Header file
|
// Open the FV Extension Header file
|
||||||
//
|
//
|
||||||
FvExtHeaderFile = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");
|
FvExtHeaderFile = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");
|
||||||
|
if (FvExtHeaderFile == NULL) {
|
||||||
|
Error (NULL, 0, 0001, "Error opening file", mFvDataInfo.FvExtHeaderFile);
|
||||||
|
return EFI_ABORTED;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the file size
|
// Get the file size
|
||||||
|
Reference in New Issue
Block a user