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:
committed by
Markus F.X.J. Oberhumer
parent
620955a724
commit
b7a5b9437a
+1
-1
@@ -180,7 +180,7 @@ bool PackVmlinuxBase<T>::canPack()
|
|||||||
int j;
|
int j;
|
||||||
for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) {
|
for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) {
|
||||||
if (Shdr::SHT_PROGBITS==p->sh_type
|
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)) {
|
&& 0==strcmp("__ksymtab", p->sh_name + shstrtab)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user