aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-21 07:42:55 +0000
committerAlan Modra <amodra@gmail.com>2010-06-21 07:42:55 +0000
commit6d0cb78c78e090501eced0284e413137aeb50875 (patch)
treecdb720813617c2448415d34b37ba72e5e849dfc8 /gas/config/tc-sh.c
parent89e38f6b1a253fd16441a5aff934e3f90d8094e5 (diff)
downloadgdb-6d0cb78c78e090501eced0284e413137aeb50875.zip
gdb-6d0cb78c78e090501eced0284e413137aeb50875.tar.gz
gdb-6d0cb78c78e090501eced0284e413137aeb50875.tar.bz2
PR gas/11733
* config/tc-sh.c (find_cooked_opcode): Correct array bounds check.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 4e49e4e..67bec05 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -2545,7 +2545,7 @@ find_cooked_opcode (char **str_p)
unsigned char *op_start;
unsigned char *op_end;
char name[20];
- int nlen = 0;
+ unsigned int nlen = 0;
/* Drop leading whitespace. */
while (*str == ' ')
@@ -2557,7 +2557,7 @@ find_cooked_opcode (char **str_p)
assemble_ppi, so the opcode might be terminated by an '@'. */
for (op_start = op_end = (unsigned char *) str;
*op_end
- && nlen < 20
+ && nlen < sizeof (name) - 1
&& !is_end_of_line[*op_end] && *op_end != ' ' && *op_end != '@';
op_end++)
{