Fix checking of sh_name versus shstrsec->sh_size

https://github.com/upx/upx/issues/509
	modified:   p_vmlinx.cpp
This commit is contained in:
John Reiser 2022-01-01 14:20:18 -08:00 committed by Markus F.X.J. Oberhumer
parent 620955a724
commit b7a5b9437a

View File

@ -180,7 +180,7 @@ bool PackVmlinuxBase<T>::canPack()
int j;
for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) {
if (Shdr::SHT_PROGBITS==p->sh_type
&& (p->sh_name + shstrsec->sh_offset) < (unsigned)file_size
&& p->sh_name < shstrsec->sh_size
&& 0==strcmp("__ksymtab", p->sh_name + shstrtab)) {
break;
}