]> git.proxmox.com Git - mirror_edk2.git/commit - BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools/GenFw: Exit with error when header lookup fails
authorMichael LeMay <michael.lemay@intel.com>
Fri, 29 Jan 2016 03:23:21 +0000 (11:23 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 17 Feb 2016 05:17:26 +0000 (13:17 +0800)
commit17751c5fa473fd4f830007590d59e8d15a2d2935
tree08160d2387fd5497c8d799d27895aa6d0c021530
parent6731c20f28cf26345e58ae232f9c1fb2dad6c09e
BaseTools/GenFw: Exit with error when header lookup fails

This patch revises GetPhdrByIndex and GetShdrByIndex to cause GenFw to
exit with an error message when a section header lookup fails.  The
current behavior of those functions in such circumstances is to return
NULL, which can cause GenFw to subsequently fault when it attempts to
dereference the null pointer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools/Source/C/GenFw/Elf64Convert.c