[binutils-gdb/binutils-2_30-branch] Import patch from mainline to fix memory corruption in MIPS assembler.

Nick Clifton nickc@sourceware.org
Fri Feb 23 11:11:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e5ccef16d86f8e23715fb9c4b2dd794ff414962d

commit e5ccef16d86f8e23715fb9c4b2dd794ff414962d
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Feb 23 11:10:42 2018 +0000

    Import patch from mainline to fix memory corruption in MIPS assembler.
    
    	PR 22014
    gas	* config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
    	instruction size suffix.

Diff:
---
 gas/ChangeLog        | 10 ++++++++++
 gas/config/tc-mips.c |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 232d246..e9dcc01 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2018-02-23  Nick Clifton  <nickc@redhat.com>
+
+	* Import from mainline:
+
+	2018-02-22  A. Wilcox  <awilfox@adelielinux.org>
+
+	PR 22014
+	* config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
+	instruction size suffix.
+
 2018-02-16  Tamar Christina  <tamar.christina@arm.com>
 
 	* config/tc-arm.c (cpu_arch_ver): Renumber ARM_ARCH_V8_4A.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 97c9109..691fb33 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -13956,7 +13956,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start,
 	suffix = 0;
       if (suffix)
 	{
-	  memcpy (name + opend - 2, name + opend, length - opend + 1);
+	  memmove (name + opend - 2, name + opend, length - opend + 1);
 	  insn = (struct mips_opcode *) hash_find (hash, name);
 	  if (insn)
 	    {



More information about the Binutils-cvs mailing list