mirror of
https://github.com/upx/upx.git
synced 2024-12-12 15:05:56 +00:00
Ignore malformed ElfXX_Shdr in search for .text or .note
https://github.com/upx/upx/issues/287 modified: p_vmlinx.cpp
This commit is contained in:
parent
23570097cf
commit
276b748aa6
@ -577,6 +577,7 @@ int PackVmlinuxBase<T>::canUnpack()
|
||||
Shdr *p;
|
||||
for (p= shdri, j= ehdri.e_shnum; --j>=0; ++p) {
|
||||
if ((unsigned)file_size < (p->sh_size + p->sh_offset)
|
||||
|| (5+ p->sh_name) < p->sh_name // wrap: ignore malformed
|
||||
|| shstrsec->sh_size < (5+ p->sh_name) ) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user