summaryrefslogtreecommitdiff
path: root/gas/config/tc-crx.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-07-14 15:34:16 +0000
committerNick Clifton <nickc@redhat.com>2005-07-14 15:34:16 +0000
commit55ecb7a8c3ac0d8f955cadd16f03163416461c05 (patch)
treed2119c456c8bf23328df0038cfb9b03283efee38 /gas/config/tc-crx.c
parent470210ec83840628ebf30709b503b6649e76d657 (diff)
downloadbinutils-redhat-55ecb7a8c3ac0d8f955cadd16f03163416461c05.tar.gz
(reset_vars): Use strncpy to prevent overflowing the ins_parse buffer.
Diffstat (limited to 'gas/config/tc-crx.c')
-rw-r--r--gas/config/tc-crx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
index 3f0c767fbc..9b0b8564c8 100644
--- a/gas/config/tc-crx.c
+++ b/gas/config/tc-crx.c
@@ -268,7 +268,8 @@ reset_vars (char *op)
memset (& output_opcode, '\0', sizeof (output_opcode));
/* Save a copy of the original OP (used in error messages). */
- strcpy (ins_parse, op);
+ strncpy (ins_parse, op, sizeof ins_parse - 1);
+ ins_parse [sizeof ins_parse - 1] = 0;
}
/* This macro decides whether a particular reloc is an entry in a