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
This commit is contained in:
firewave 2018-01-20 12:47:18 +01:00
parent 5e3467af40
commit 1978424daa
2 changed files with 2 additions and 2 deletions

View File

@ -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])
{

View File

@ -71,7 +71,7 @@ private:
R_ALM_HOURS
};
u8 m_regs[10];
u8 m_regs[11];
bool m_comparator_state;
// timers