aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-01-20 10:32:25 +0000
committerNick Clifton <nickc@redhat.com>2017-01-20 10:32:25 +0000
commit9d46ce346fe3028d3d57332f286f3895c0724876 (patch)
tree787f391f98454f528fb06146b934526ce78cadbc /gas/config
parenta24df3057179f81a2624bf3bd3d78113cb2fcc8e (diff)
downloadgdb-9d46ce346fe3028d3d57332f286f3895c0724876.zip
gdb-9d46ce346fe3028d3d57332f286f3895c0724876.tar.gz
gdb-9d46ce346fe3028d3d57332f286f3895c0724876.tar.bz2
Fix potential array overrun in x86 assembler.
* config/tc-i386.c (parse_operands): Check for operand overflow before setting the unspecified bit.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 80812cf..1fc6bc7 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4136,13 +4136,13 @@ parse_operands (char *l, const char *mnemonic)
{ /* Yes, we've read in another operand. */
unsigned int operand_ok;
this_operand = i.operands++;
- i.types[this_operand].bitfield.unspecified = 1;
if (i.operands > MAX_OPERANDS)
{
as_bad (_("spurious operands; (%d operands/instruction max)"),
MAX_OPERANDS);
return NULL;
}
+ i.types[this_operand].bitfield.unspecified = 1;
/* Now parse operand adding info to 'i' as we go along. */
END_STRING_AND_SAVE (l);