From ae9f8fb639f7459cc5c270750f27b8fe2e1ccef7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 15 Jan 2020 02:20:55 +0100 Subject: [PATCH] Fixed a potential NULL pointer dereference in the SCAT code. --- src/chipset/scat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/scat.c b/src/chipset/scat.c index 5ffa3722a..fce0e772b 100644 --- a/src/chipset/scat.c +++ b/src/chipset/scat.c @@ -1354,7 +1354,7 @@ mem_write_scatb(uint32_t addr, uint8_t val, void *priv) } if (chkaddr >= 0xc0000 && chkaddr < 0x100000) { - if (dev->regs[SCAT_RAM_WRITE_PROTECT] & (1 << ((chkaddr - 0xc0000) >> 15))) + if ((dev == NULL) || (dev->regs[SCAT_RAM_WRITE_PROTECT] & (1 << ((chkaddr - 0xc0000) >> 15)))) return; }