From 1978424daaad95cf98b88eb0b62edbe6029ea0cf Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 20 Jan 2018 12:47:18 +0100 Subject: cdp1879.cpp: fixed Coverity out-of-bounds warnings (nw) - m_regs seems to be too small since R_CNT_HOURS is 4 and it will access m_regs at + 6 - so index 10 would be out of bounds - device_timer() also checked the alarm latch for the months which is never written and doesn't exist according to the data sheet --- src/devices/machine/cdp1879.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/devices/machine/cdp1879.cpp') diff --git a/src/devices/machine/cdp1879.cpp b/src/devices/machine/cdp1879.cpp index c42a6120b4d..6fbc376df28 100644 --- a/src/devices/machine/cdp1879.cpp +++ b/src/devices/machine/cdp1879.cpp @@ -70,7 +70,7 @@ void cdp1879_device::device_timer(emu_timer &timer, device_timer_id id, int para // comparator IRQ bool new_state = true; - for (int i = R_CNT_SECONDS; i <= R_CNT_MONTH; i++) + for (int i = R_CNT_SECONDS; i <= R_CNT_HOURS; i++) { if(m_regs[i] != m_regs[i + 6]) { -- cgit v1.2.3-70-g09d2