X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Fia64-opc.c;h=5aa1198ec533f877f12fb9253ed8b99f4ebe3dda;hb=4970191fa557c4769697fb41db06f2dcb5f7de2e;hp=52ceac981611aed17e6ee1d6bf8558c3581ed17a;hpb=4b95cf5c0c75d6efc1b2f96af72317aecca079f1;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c index 52ceac9816..5aa1198ec5 100644 --- a/opcodes/ia64-opc.c +++ b/opcodes/ia64-opc.c @@ -1,5 +1,5 @@ /* ia64-opc.c -- Functions to access the compacted opcode table - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. Written by Bob Manson of Cygnus Solutions, This file is part of the GNU opcodes library. @@ -123,7 +123,7 @@ static short find_main_ent (short nameindex) { short start = 0; - short end = sizeof (main_table) / sizeof (struct ia64_main_table); + short end = ARRAY_SIZE (main_table); short i = (start + end) / 2; if (nameindex < main_table[0].name_index @@ -612,6 +612,9 @@ ia64_find_matching_opcode (const char *name, short place) const char *suffix; short name_index; + if ((unsigned) place >= ARRAY_SIZE (main_table)) + return NULL; + if (strlen (name) > 128) { return NULL;