1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Ensures no buffer overrun when installing the OS ROM.

This commit is contained in:
Thomas Harte 2018-07-10 21:49:38 -04:00
parent 57f161e64c
commit efd812cf22

View File

@ -486,7 +486,7 @@ class ConcreteMachine:
case ROM::ADFS1: adfs1_ = data; return; case ROM::ADFS1: adfs1_ = data; return;
case ROM::ADFS2: adfs2_ = data; return; case ROM::ADFS2: adfs2_ = data; return;
case ROM::OS: target = os_; break; case ROM::OS: target = os_; return;
default: default:
target = roms_[static_cast<int>(slot)]; target = roms_[static_cast<int>(slot)];
rom_write_masks_[static_cast<int>(slot)] = is_writeable; rom_write_masks_[static_cast<int>(slot)] = is_writeable;
@ -500,7 +500,9 @@ class ConcreteMachine:
std::memcpy(&target[rom_ptr], data.data(), size_to_copy); std::memcpy(&target[rom_ptr], data.data(), size_to_copy);
rom_ptr += size_to_copy; rom_ptr += size_to_copy;
} }
rom_inserted_[static_cast<int>(slot)] = true;
if(static_cast<int>(slot) < 16)
rom_inserted_[static_cast<int>(slot)] = true;
} }
// MARK: - Work deferral updates. // MARK: - Work deferral updates.