Don't use variable length arrays (VLA).
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ CXXFLAGS += -fno-delete-null-pointer-checks
|
|||||||
endif
|
endif
|
||||||
CXXFLAGS += -fno-strict-aliasing -fwrapv
|
CXXFLAGS += -fno-strict-aliasing -fwrapv
|
||||||
CXXFLAGS += -funsigned-char
|
CXXFLAGS += -funsigned-char
|
||||||
CXXFLAGS += -Wall -W -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wwrite-strings
|
CXXFLAGS += -Wall -W -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings
|
||||||
CXXFLAGS_WERROR ?= -Werror
|
CXXFLAGS_WERROR ?= -Werror
|
||||||
CXXFLAGS += $(CXXFLAGS_WERROR)
|
CXXFLAGS += $(CXXFLAGS_WERROR)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -684,8 +684,8 @@ void PackMachBase<T>::pack4(OutputFile *fo, Filter &ft) // append PackHeader
|
|||||||
}
|
}
|
||||||
if (my_filetype == Mach_header::MH_EXECUTE) {
|
if (my_filetype == Mach_header::MH_EXECUTE) {
|
||||||
// Get a writeable copy of the stub to make editing easier.
|
// Get a writeable copy of the stub to make editing easier.
|
||||||
unsigned char upxstub[sz_stub_main];
|
ByteArray(upxstub, sz_stub_main);
|
||||||
memcpy(upxstub, stub_main, sizeof(upxstub));
|
memcpy(upxstub, stub_main, sz_stub_main);
|
||||||
|
|
||||||
Mach_header *const mhp = (Mach_header *)upxstub;
|
Mach_header *const mhp = (Mach_header *)upxstub;
|
||||||
char *tail = (char *)(1+ mhp);
|
char *tail = (char *)(1+ mhp);
|
||||||
|
|||||||
Reference in New Issue
Block a user