--- nono/vm/msxdos.cpp 2026/04/29 17:05:17 1.1.1.1 +++ nono/vm/msxdos.cpp 2026/04/29 17:05:21 1.1.1.2 @@ -156,16 +156,12 @@ MSXDOSDevice::Init() } // コピー - if (src.size >= 0x7000 - 0x100) { - src.size = 0x7000 - 0x100; - } xs.SetAddr(0x100); for (int i = 0; i < src.size; i++) { xs.Write8(src.data[i]); } delete[] src.data; - return true; } @@ -221,6 +217,13 @@ MSXDOSDevice::LoadBinary(const char *fil } } + // サイズ制限 + if (dl.size >= 0x7000 - 0x100) { + errno = EFBIG; + warn("%s", filename); + return dl; + } + try { dl.data = new uint8 [dl.size]; } catch (...) {