From 777a30c82ff54cf52064c1e0c792530f59d7c5f6 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 21 Jun 2010 07:42:55 +0000 Subject: [PATCH] PR gas/11733 * config/tc-sh.c (find_cooked_opcode): Correct array bounds check. --- gas/ChangeLog | 5 +++++ gas/config/tc-sh.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 83ed094aa..b899092fb 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2010-06-21 Alan Modra + + PR gas/11733 + * config/tc-sh.c (find_cooked_opcode): Correct array bounds check. + 2010-06-18 Joseph Myers * config/tc-tic6x.h (tic6x_segment_info_type): Add field diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 4e49e4e8c..67bec05c3 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++) { -- 2.11.4.GIT