mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Detect Mach_header.sizeofcmds==0
https://github.com/upx/upx/issues/448 modified: p_mach.cpp
This commit is contained in:
parent
c9fe84c9aa
commit
80de11bc5b
|
@ -1811,8 +1811,9 @@ bool PackMachBase<T>::canPack()
|
|||
char buf[32]; snprintf(buf, sizeof(buf), "bad sizeofcmds %d", sz_mhcmds);
|
||||
throwCantPack(buf);
|
||||
}
|
||||
if (16384 < sz_mhcmds) { // somewhat arbitrary, but amd64-darwin.macho-upxmain.c
|
||||
throwCantPack("16384 < Mach_header.sizeofcmds");
|
||||
if (!sz_mhcmds
|
||||
|| 16384 < sz_mhcmds) { // somewhat arbitrary, but amd64-darwin.macho-upxmain.c
|
||||
throwCantPack("16384 < Mach_header.sizeofcmds (or ==0)");
|
||||
}
|
||||
rawmseg_buf.alloc(sz_mhcmds);
|
||||
rawmseg = (Mach_segment_command *)(void *)rawmseg_buf;
|
||||
|
|
Loading…
Reference in New Issue
Block a user