forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user