Check Mach_command.cmdsize

https://github.com/upx/upx/issues/426
Also use MemBuffer to avoid leaks that result from throw()
	modified:   p_mach.cpp
	modified:   p_mach.h
This commit is contained in:
John Reiser
2020-11-28 10:56:28 -08:00
committed by Markus F.X.J. Oberhumer
parent a928a08f9d
commit 1879185e42
2 changed files with 27 additions and 15 deletions
+5
View File
@@ -818,8 +818,13 @@ protected:
upx_byte const *stub_entry;
upx_byte const *stub_fold;
upx_byte const *stub_main;
MemBuffer rawmseg_buf; // Mach_segment_command[];
Mach_segment_command *rawmseg; // as input, with sections
MemBuffer msegcmd_buf; // Mach_segment_command[];
Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections
unsigned o__mod_init_func; // file offset to __DATA.__mod_init_func Mach_section_command
upx_uint64_t prev_mod_init_func;
upx_uint64_t pagezero_vmsize;