X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=opcodes%2Fia64-opc.c;h=5aa1198ec533f877f12fb9253ed8b99f4ebe3dda;hb=refs%2Fheads%2Fsandbox%2Fvbarinov%2Fupstream233;hp=539fa9b2d765ce320bb57201c309ca49205485d2;hpb=91d6fa6a035cc7d0b7be5c99c194a64cb80924b0;p=external%2Fbinutils.git diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c index 539fa9b..5aa1198 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 1999, 2000, 2001, 2003, 2005, 2007, 2009 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. @@ -19,7 +19,6 @@ Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "ansidecl.h" #include "sysdep.h" #include "libiberty.h" #include "ia64-asmtab.h" @@ -124,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 @@ -613,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;