Fix address violation when disassembling a corrupt RL78 binary.
PR binutils/21588 * rl78-decode.opc (OP_BUF_LEN): Define. (GETBYTE): Check for the index exceeding OP_BUF_LEN. (rl78_decode_opcode): Use OP_BUF_LEN as the length of the op_buf array. * rl78-decode.c: Regenerate.
This commit is contained in:
parent
76800cba59
commit
63323b5b23
|
@ -1,3 +1,12 @@
|
|||
2017-06-15 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21588
|
||||
* rl78-decode.opc (OP_BUF_LEN): Define.
|
||||
(GETBYTE): Check for the index exceeding OP_BUF_LEN.
|
||||
(rl78_decode_opcode): Use OP_BUF_LEN as the length of the op_buf
|
||||
array.
|
||||
* rl78-decode.c: Regenerate.
|
||||
|
||||
2017-06-15 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21586
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -50,7 +50,9 @@ typedef struct
|
|||
#define W() rl78->size = RL78_Word
|
||||
|
||||
#define AU ATTRIBUTE_UNUSED
|
||||
#define GETBYTE() (ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr))
|
||||
|
||||
#define OP_BUF_LEN 20
|
||||
#define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
|
||||
#define B ((unsigned long) GETBYTE())
|
||||
|
||||
#define SYNTAX(x) rl78->syntax = x
|
||||
|
@ -168,7 +170,7 @@ rl78_decode_opcode (unsigned long pc AU,
|
|||
RL78_Dis_Isa isa)
|
||||
{
|
||||
LocalData lds, * ld = &lds;
|
||||
unsigned char op_buf[20] = {0};
|
||||
unsigned char op_buf[OP_BUF_LEN] = {0};
|
||||
unsigned char *op = op_buf;
|
||||
int op0, op1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue