Added sanity checks to the vmware4 and vvfat mode to avoid data corruption.
Some compilers need special options to pack structures correctly. Added example for gcc 4.7+ on Windows to shortcut script.
This commit is contained in:
parent
635774e1da
commit
57272ac32e
@ -7,6 +7,7 @@
|
||||
CC="gcc"
|
||||
CXX="g++"
|
||||
CFLAGS="-O3 -Wall -Wno-format -mno-cygwin"
|
||||
#CFLAGS="-O3 -Wall -Wno-format -march=pentium -mno-ms-bitfields" # for GCC 4.7+
|
||||
CXXFLAGS="$CFLAGS"
|
||||
|
||||
export CC
|
||||
|
@ -53,6 +53,9 @@ vmware4_image_t::vmware4_image_t()
|
||||
current_offset(INVALID_OFFSET),
|
||||
is_dirty(0)
|
||||
{
|
||||
if (sizeof(_VM4_Header) != 72) {
|
||||
BX_PANIC(("system error: invalid header structure size"));
|
||||
}
|
||||
}
|
||||
|
||||
vmware4_image_t::~vmware4_image_t()
|
||||
|
@ -343,6 +343,10 @@ infosector_t;
|
||||
|
||||
vvfat_image_t::vvfat_image_t(Bit64u size, const char* _redolog_name)
|
||||
{
|
||||
if (sizeof(bootsector_t) != 512) {
|
||||
BX_PANIC(("system error: invalid bootsector structure size"));
|
||||
}
|
||||
|
||||
first_sectors = new Bit8u[0xc000];
|
||||
memset(&first_sectors[0], 0, 0xc000);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user