From 8640c87dcd4528e19dc060bfac801f9084fbf4e2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Aug 2020 17:46:59 +0930 Subject: [PATCH] PR26504, ASAN: parse_disassembler_options vax-dis.c:142 PR 26504 * vax-dis.c (parse_disassembler_options): Always add at least one to entry_addr_total_slots. --- opcodes/ChangeLog | 6 ++++++ opcodes/vax-dis.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index f2dbc22e806..f1951d48817 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2020-08-25 Alan Modra + + PR 26504 + * vax-dis.c (parse_disassembler_options): Always add at least one + to entry_addr_total_slots. + 2020-08-24 Cooper Qu * csky-dis.c (csky_find_inst_info): Skip CK860's instructions diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c index f58c4ad4f2d..3efbf3d0db4 100644 --- a/opcodes/vax-dis.c +++ b/opcodes/vax-dis.c @@ -129,8 +129,8 @@ parse_disassembler_options (const char *options) if (entry_addr_occupied_slots >= entry_addr_total_slots) { /* A guesstimate of the number of entries we will have to create. */ - entry_addr_total_slots += - strlen (options) / (strlen (entry_switch) + 5); + entry_addr_total_slots + += 1 + strlen (options) / (strlen (entry_switch) + 5); entry_addr = realloc (entry_addr, sizeof (bfd_vma) * entry_addr_total_slots); -- 2.30.2