1
0
mirror of https://github.com/upx/upx.git synced 2025-08-07 22:46:51 +08:00

src: add a mem_size() call hinted by GitHub CodeQL

This commit is contained in:
Markus F.X.J. Oberhumer
2022-09-21 19:28:46 +02:00
parent b720b47c12
commit 4256057c27

View File

@ -107,7 +107,7 @@ typename T::Shdr const *PackVmlinuxBase<T>::getElfSections()
unsigned const e_shnum = ehdri.e_shnum;
if (ehdri.e_shentsize != sizeof(*shdri)
|| file_size_u < ehdri.e_shoff
|| file_size_u < ehdri.e_shoff + ehdri.e_shentsize * e_shnum) {
|| file_size_u < ehdri.e_shoff + mem_size(ehdri.e_shentsize, e_shnum)) {
throwCantPack("bad ElfXX_Shdrs");
}
shdri = new Shdr[(unsigned) e_shnum];