[MT04028] fixed array out-of-bound write in pinkiri8_state::ronjan_prot_w [Oliver Stöneberg]

This commit is contained in:
Oliver Stöneberg 2013-02-09 13:52:37 +00:00
parent 49ae3ba077
commit 80dbbd9bfd

View File

@ -63,7 +63,7 @@ public:
int m_prev_writes; int m_prev_writes;
UINT8 m_mux_data; UINT8 m_mux_data;
UINT8 m_prot_read_index; UINT8 m_prot_read_index;
UINT8 m_prot_char[6]; UINT8 m_prot_char[5];
UINT8 m_prot_index; UINT8 m_prot_index;
DECLARE_WRITE8_MEMBER(output_regs_w); DECLARE_WRITE8_MEMBER(output_regs_w);
DECLARE_WRITE8_MEMBER(pinkiri8_vram_w); DECLARE_WRITE8_MEMBER(pinkiri8_vram_w);
@ -1227,8 +1227,10 @@ WRITE8_MEMBER(pinkiri8_state::ronjan_prot_w)
} }
else else
{ {
m_prot_char[m_prot_index] = data; if(m_prot_index == 5)
m_prot_index++; 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') 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; m_prot_read_index = 0;