]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Fix crash in ECC when parsing incorrect header
authorSami Mujawar <sami.mujawar@arm.com>
Thu, 22 Oct 2020 08:42:51 +0000 (09:42 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 22 Dec 2020 01:26:10 +0000 (01:26 +0000)
commitb23c5b9722b50d598f861c057122e91fa3e6b3fe
tree4919d755fe74ec595563807be664a1a87cef3370
parent35ed29f207fd9c3683cfee5492c5c4e96ee0a0eb
BaseTools: Fix crash in ECC when parsing incorrect header

The ECC tool crashes if a C file has an incorrect file header
format.

The file ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuPeiLibConstructor.c
has a file header in the incorrect format. It uses # to mark the
header comments instead of enclosing the file header in /* */. This
may have been a result of an INF file header being copied to a C
file.

A separate patch fixes the C file but ECC tool should
not crash if a file with an incorrect header is found.

Therefore, update the ECC tool to prevent it from crashing if an
incorrect file header is found. With this change the ECC tool will
report the incorrect header issue without crashing.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
BaseTools/Source/Python/Ecc/c.py