aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-06-19 10:25:35 +0930
committerAlan Modra <amodra@gmail.com>2021-06-19 11:08:56 +0930
commit47399e9c455b0a634e4c3597c8d9a292cc4b1b0c (patch)
treedef9d106bf045cd945c8cea5ba82828144d24bce
parent03e689aaac95da0b22f7689a2c307e8ddd99ae2c (diff)
downloadgdb-47399e9c455b0a634e4c3597c8d9a292cc4b1b0c.zip
gdb-47399e9c455b0a634e4c3597c8d9a292cc4b1b0c.tar.gz
gdb-47399e9c455b0a634e4c3597c8d9a292cc4b1b0c.tar.bz2
ubsan: vax: pointer overflow
"VAX export class call relocation test" fails with ubsan on a 32-bit host. * vax-dis.c (print_insn_vax): Avoid pointer overflow.
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/vax-dis.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index f262529..035182c 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
2021-06-19 Alan Modra <amodra@gmail.com>
+ * vax-dis.c (print_insn_vax): Avoid pointer overflow.
+
+2021-06-19 Alan Modra <amodra@gmail.com>
+
* tic30-dis.c (get_register_operand): Don't ask strncpy to fill
entire buffer.
diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c
index e218d49..ed4610b 100644
--- a/opcodes/vax-dis.c
+++ b/opcodes/vax-dis.c
@@ -490,7 +490,7 @@ print_insn_vax (bfd_vma memaddr, disassemble_info *info)
while (*argp)
{
- arg += print_insn_arg (argp, arg, memaddr + arg - buffer, info);
+ arg += print_insn_arg (argp, arg, memaddr + (arg - buffer), info);
argp += 2;
if (*argp)
(*info->fprintf_func) (info->stream, ",");