From 08330de7f4e40b37c24b77f691e6c45e58007e90 Mon Sep 17 00:00:00 2001 From: Bill Beech Date: Tue, 4 Feb 2020 16:26:29 -0700 Subject: [PATCH] swtp6800: Correct address bound on memory write --- swtp6800/common/mp-8m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swtp6800/common/mp-8m.c b/swtp6800/common/mp-8m.c index 0cee9993..7cff2a88 100644 --- a/swtp6800/common/mp-8m.c +++ b/swtp6800/common/mp-8m.c @@ -187,7 +187,7 @@ void mp_8m_put_mbyte(int32 addr, int32 val) uptr = mp_8m_dev.units + i; org = uptr->u3; len = uptr->capac - 1; - if ((addr >= org) && (addr < org + len)) { + if ((addr >= org) && (addr <= org + len)) { *((uint8 *)(uptr->filebuf) + (addr - org)) = val & 0xFF; sim_debug (DEBUG_write, &mp_8m_dev, "\n"); return;