From 80dbbd9bfdaf41fbb58a1776a6f8352468579d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 9 Feb 2013 13:52:37 +0000 Subject: [PATCH] =?UTF-8?q?[MT04028]=20fixed=20array=20out-of-bound=20writ?= =?UTF-8?q?e=20in=20pinkiri8=5Fstate::ronjan=5Fprot=5Fw=20[Oliver=20St?= =?UTF-8?q?=C3=B6neberg]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mame/drivers/pinkiri8.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c index f17a3ec9b5f..e61b4660433 100644 --- a/src/mame/drivers/pinkiri8.c +++ b/src/mame/drivers/pinkiri8.c @@ -63,7 +63,7 @@ public: int m_prev_writes; UINT8 m_mux_data; UINT8 m_prot_read_index; - UINT8 m_prot_char[6]; + UINT8 m_prot_char[5]; UINT8 m_prot_index; DECLARE_WRITE8_MEMBER(output_regs_w); DECLARE_WRITE8_MEMBER(pinkiri8_vram_w); @@ -1227,8 +1227,10 @@ WRITE8_MEMBER(pinkiri8_state::ronjan_prot_w) } else { - m_prot_char[m_prot_index] = data; - m_prot_index++; + if(m_prot_index == 5) + return; + + m_prot_char[m_prot_index++] = data; if(m_prot_char[0] == 'E' && m_prot_char[1] == 'R' && m_prot_char[2] == 'R' && m_prot_char[3] == 'O' && m_prot_char[4] == 'R') m_prot_read_index = 0;