From 47399e9c455b0a634e4c3597c8d9a292cc4b1b0c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 19 Jun 2021 10:25:35 +0930 Subject: [PATCH] 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. --- opcodes/ChangeLog | 4 ++++ opcodes/vax-dis.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index f262529d566..035182c4a47 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2021-06-19 Alan Modra + + * vax-dis.c (print_insn_vax): Avoid pointer overflow. + 2021-06-19 Alan Modra * tic30-dis.c (get_register_operand): Don't ask strncpy to fill diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c index e218d4969ca..ed4610b7afa 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, ","); -- 2.30.2