mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-28 12:33:36 +08:00
PR26481 UBSAN: tc-pj.c:281 index out of bounds
PR 26481 * config/tc-pj.c (md_assemble): Don't loop past end of opcode->arg array.
This commit is contained in:
parent
736c9875c0
commit
8a267ea847
@ -1,3 +1,9 @@
|
||||
2020-08-29 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26481
|
||||
* config/tc-pj.c (md_assemble): Don't loop past end of
|
||||
opcode->arg array.
|
||||
|
||||
2020-08-28 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26460
|
||||
|
@ -270,7 +270,7 @@ md_assemble (char *str)
|
||||
}
|
||||
else
|
||||
{
|
||||
int an;
|
||||
unsigned int an;
|
||||
|
||||
output = frag_more (opcode->len);
|
||||
output[idx++] = opcode->opcode;
|
||||
@ -278,7 +278,7 @@ md_assemble (char *str)
|
||||
if (opcode->opcode_next != -1)
|
||||
output[idx++] = opcode->opcode_next;
|
||||
|
||||
for (an = 0; opcode->arg[an]; an++)
|
||||
for (an = 0; an < ARRAY_SIZE (opcode->arg) && opcode->arg[an]; an++)
|
||||
{
|
||||
expressionS arg;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user