aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/physmem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/system/physmem.c b/system/physmem.c
index f498572..3110111 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -3231,8 +3231,10 @@ static inline MemTxResult address_space_write_rom_internal(AddressSpace *as,
}
}
len -= l;
- buf += l;
addr += l;
+ if (buf) {
+ buf += l;
+ }
}
return MEMTX_OK;
}