mirror of https://github.com/acidanthera/audk.git
BaseTools/GenCrc32: Fix a bug to hand empty file for decode
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=535 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
b5bd6387d2
commit
997b2c5437
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Calculate Crc32 value and Verify Crc32 value for input data.
|
||||
|
||||
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
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
|
||||
|
@ -80,7 +80,7 @@ Returns:
|
|||
//
|
||||
// Copyright declaration
|
||||
//
|
||||
fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");
|
||||
fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.\n\n");
|
||||
|
||||
//
|
||||
// Details Option
|
||||
|
@ -326,6 +326,10 @@ Returns:
|
|||
//
|
||||
// Verify Crc32 Value
|
||||
//
|
||||
if (FileSize < sizeof (UINT32)) {
|
||||
Error (NULL, 0, 3000, "Invalid", "Input file is invalid!");
|
||||
goto Finish;
|
||||
}
|
||||
Status = CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value);
|
||||
if (Status != EFI_SUCCESS) {
|
||||
Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
|
||||
|
|
Loading…
Reference in New Issue