Don't use variable length arrays (VLA).

This commit is contained in:
Markus F.X.J. Oberhumer
2016-10-06 13:04:46 +02:00
parent b3a8d02caf
commit 6e76f8ef3a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -684,8 +684,8 @@ void PackMachBase<T>::pack4(OutputFile *fo, Filter &ft) // append PackHeader
}
if (my_filetype == Mach_header::MH_EXECUTE) {
// Get a writeable copy of the stub to make editing easier.
unsigned char upxstub[sz_stub_main];
memcpy(upxstub, stub_main, sizeof(upxstub));
ByteArray(upxstub, sz_stub_main);
memcpy(upxstub, stub_main, sz_stub_main);
Mach_header *const mhp = (Mach_header *)upxstub;
char *tail = (char *)(1+ mhp);