diff options
author | Alan Modra <amodra@gmail.com> | 2010-08-25 11:51:07 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-08-25 11:51:07 +0000 |
commit | 4ad7ac30ca9fdb05146eb68f324001e30765ad27 (patch) | |
tree | 492314b6b2bbbf70d6f9cefd40278908fe253e0a /gas/config/tc-m68hc11.c | |
parent | ca09d69af126b596bf21c9d3f7639cae5cd32533 (diff) | |
download | gdb-4ad7ac30ca9fdb05146eb68f324001e30765ad27.zip gdb-4ad7ac30ca9fdb05146eb68f324001e30765ad27.tar.gz gdb-4ad7ac30ca9fdb05146eb68f324001e30765ad27.tar.bz2 |
* config/tc-d10v.c (do_assemble): Correctly detect overflow of
"name" buffer.
* config/tc-m68hc11.c (md_assemble): Likewise.
* config/tc-microblaze.c (md_assemble): Likewise. Correct cast
of is_end_of_line index.
Diffstat (limited to 'gas/config/tc-m68hc11.c')
-rw-r--r-- | gas/config/tc-m68hc11.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index c314961..2e328ea 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -2403,11 +2403,13 @@ md_assemble (char *str) /* Find the opcode end and get the opcode in 'name'. The opcode is forced lower case (the opcode table only has lower case op-codes). */ for (op_start = op_end = (unsigned char *) str; - *op_end && nlen < 20 && !is_end_of_line[*op_end] && *op_end != ' '; + *op_end && !is_end_of_line[*op_end] && *op_end != ' '; op_end++) { name[nlen] = TOLOWER (op_start[nlen]); nlen++; + if (nlen == sizeof (name) - 1) + break; } name[nlen] = 0; |