Fixed out-of-bounds array accesses in the peplus and videopkr drivers [Oliver Stöneberg]

---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Sun, Nov 15, 2009 at 3:43 PM
Subject: fixes for cppcheck issues
To: submit@mamedev.org


The following patch fixes some issues reported by cppcheck:
- buffer out-of-bounds accesses in mame/drivers/peplus.c and
mame/drivers/videopkr.c (the latter hopefully fixing the long-
standing crashing issue)
- compilation of mame/machine/irobot.c when DISASSEMBLE_MB_ROM is set
to 1
This commit is contained in:
Phil Bennett 2009-11-16 15:41:10 +00:00
parent 68d6aaaa55
commit 9246ea1028
3 changed files with 2 additions and 3 deletions

View File

@ -375,7 +375,7 @@ static WRITE8_HANDLER( peplus_duart_w )
static WRITE8_HANDLER( peplus_cmos_w )
{
char bank_name[5];
char bank_name[6];
/* Test for Wingboard PAL Trigger Condition */
if (offset == 0x1fff && wingboard && data < 5)

View File

@ -327,7 +327,7 @@ static UINT8 dec_7seg(int data)
static void count_7dig(unsigned long data, UINT8 index)
{
UINT8 i;
char strn[7];
char strn[8];
sprintf(strn,"%7lu",data);
for (i = 0; i < 7; i++)

View File

@ -1018,6 +1018,5 @@ static void disassemble_instruction(irmb_ops *op)
if (op->jtype != 7) logerror(" %04X \n",op->nxtadd);
if (op->jtype == 5) logerror("\n");
}
}
}
#endif