]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix memory corruption when using memcpy to overwtite a string in place.
authorA. Wilcox <awilfox@adelielinux.org>
Thu, 22 Feb 2018 13:00:36 +0000 (13:00 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 22 Feb 2018 13:00:36 +0000 (13:00 +0000)
PR 22014
* config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
instruction size suffix.

gas/ChangeLog
gas/config/tc-mips.c

index 6eb20f0b86ea7ab730b339a28967c105c701988d..3a0bbd7abee71b442a525d66df26a575a7070d78 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2017-12-12  Alan Modra  <amodra@gmail.com>
 
        PR 21118
index 618de6c6e5707fec41d6fab07f03c56f2306e709..1727996db0219948e0c531d7677233b6887f04f2 100644 (file)
@@ -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)
            {