From 72e366db620f5b2264290d9ba3b62df74bd0c40b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 12 Sep 2022 18:58:53 +0930 Subject: ubsan: som_is_space null dereference On objcopy of fuzzed file. * som.c (som_write_fixups): Exit loop if space sections all processed. --- bfd/som.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bfd/som.c') diff --git a/bfd/som.c b/bfd/som.c index c22f13b..38c574a 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -2933,8 +2933,10 @@ som_write_fixups (bfd *abfd, asection *subsection; /* Find a space. */ - while (!som_is_space (section)) + while (section && !som_is_space (section)) section = section->next; + if (!section) + break; /* Now iterate through each of its subspaces. */ for (subsection = abfd->sections; -- cgit v1.1