From 3931cb7871a9cabf63e7c91bcb685bac2e72c22b Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 1 Oct 2017 16:14:09 -0700 Subject: [PATCH] off_t is signed and long; keep the long when discarding the signed. https://github.com/upx/upx/issues/127 modified: p_vmlinx.cpp --- src/p_vmlinx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_vmlinx.cpp b/src/p_vmlinx.cpp index 9d5ad629..b430a277 100644 --- a/src/p_vmlinx.cpp +++ b/src/p_vmlinx.cpp @@ -111,7 +111,8 @@ typename T::Shdr const *PackVmlinuxBase::getElfSections() int j; for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) { if (Shdr::SHT_STRTAB==p->sh_type - && (p->sh_size + p->sh_offset) <= (unsigned) file_size + && (p->sh_size + p->sh_offset) <= (unsigned long)file_size + && p->sh_name < p->sh_size && (10+ p->sh_name) <= p->sh_size // 1+ strlen(".shstrtab") ) { delete [] shstrtab;