From 4256057c270c96fcebea0117593381769131b2ab Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 21 Sep 2022 19:28:46 +0200 Subject: [PATCH] src: add a mem_size() call hinted by GitHub CodeQL --- src/p_vmlinx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_vmlinx.cpp b/src/p_vmlinx.cpp index b2bb9948..e1650515 100644 --- a/src/p_vmlinx.cpp +++ b/src/p_vmlinx.cpp @@ -107,7 +107,7 @@ typename T::Shdr const *PackVmlinuxBase::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];