(reset_vars): Use strncpy to prevent overflowing the ins_parse buffer.
[deliverable/binutils-gdb.git] / gas / config / tc-crx.c
index 3f0c767fbc22eb98d0e9d1d7dd1d701664d66bcb..9b0b8564c8d00a33146f4e2fbe079bc7b029aff1 100644 (file)
@@ -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
This page took 0.025924 seconds and 4 git commands to generate.