Check the input file pointer before use it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Guo, Dong <guo.dong@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15412 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2014-03-28 05:51:51 +00:00 committed by ydong10
parent c4571f0479
commit 7a1f792dcf
2 changed files with 8 additions and 4 deletions

View File

@ -15,7 +15,7 @@
TrEEMeasureGptTable() function will receive untrusted GPT partition table, and parse TrEEMeasureGptTable() function will receive untrusted GPT partition table, and parse
partition data carefully. partition data carefully.
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -351,7 +351,9 @@ TrEEMeasurePeImage (
ImageLoad->ImageLengthInMemory = ImageSize; ImageLoad->ImageLengthInMemory = ImageSize;
ImageLoad->ImageLinkTimeAddress = LinkTimeBase; ImageLoad->ImageLinkTimeAddress = LinkTimeBase;
ImageLoad->LengthOfDevicePath = FilePathSize; ImageLoad->LengthOfDevicePath = FilePathSize;
CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize); if ((FilePath != NULL) && (FilePathSize != 0)) {
CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize);
}
// //
// Log the PE data // Log the PE data

View File

@ -15,7 +15,7 @@
TcgMeasureGptTable() function will receive untrusted GPT partition table, and parse TcgMeasureGptTable() function will receive untrusted GPT partition table, and parse
partition data carefully. partition data carefully.
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -371,7 +371,9 @@ TcgMeasurePeImage (
ImageLoad->ImageLengthInMemory = ImageSize; ImageLoad->ImageLengthInMemory = ImageSize;
ImageLoad->ImageLinkTimeAddress = LinkTimeBase; ImageLoad->ImageLinkTimeAddress = LinkTimeBase;
ImageLoad->LengthOfDevicePath = FilePathSize; ImageLoad->LengthOfDevicePath = FilePathSize;
CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize); if ((FilePath != NULL) && (FilePathSize != 0)) {
CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize);
}
// //
// Check PE/COFF image // Check PE/COFF image