1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

off_t is signed and long; keep the long when discarding the signed.

https://github.com/upx/upx/issues/127
	modified:   p_vmlinx.cpp
This commit is contained in:
John Reiser 2017-10-01 16:14:09 -07:00
parent 26be845563
commit 3931cb7871

View File

@ -111,7 +111,8 @@ typename T::Shdr const *PackVmlinuxBase<T>::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;