1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

Bounds check shstrtab in PackVmlinuxBase<T>::canPack()

This commit is contained in:
John Reiser 2015-08-10 05:45:52 -07:00
parent b89c3ebb42
commit 718a1da262

View File

@ -165,6 +165,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
&& 0==strcmp("__ksymtab", p->sh_name + shstrtab)) { && 0==strcmp("__ksymtab", p->sh_name + shstrtab)) {
break; break;
} }