mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 11:04:18 +08:00
ubsan: crx: index 5 out of bounds for type 'operand_desc const[5]'
* crx-dis.c (get_number_of_operands): Don't access operands[] out of bounds.
This commit is contained in:
parent
6c2ca6c25d
commit
100b122fc1
@ -1,3 +1,8 @@
|
||||
2019-12-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* crx-dis.c (get_number_of_operands): Don't access operands[]
|
||||
out of bounds.
|
||||
|
||||
2019-12-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* v850-dis.c (disassemble): Avoid signed overflow. Don't use
|
||||
|
@ -105,7 +105,7 @@ get_number_of_operands (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; instruction->operands[i].op_type && i < MAX_OPERANDS; i++)
|
||||
for (i = 0; i < MAX_OPERANDS && instruction->operands[i].op_type; i++)
|
||||
;
|
||||
|
||||
return i;
|
||||
|
Loading…
Reference in New Issue
Block a user