From: Nick Clifton Date: Mon, 9 Oct 2023 16:13:25 +0000 (+0100) Subject: Fix: A potential null_pointer_deference bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee1cb49e5a9de8049d887abd8c9f2eff1851147e;p=binutils-gdb.git Fix: A potential null_pointer_deference bug PR 30954 * ldlang.c (map_input_to_output_sections): Check that os is non NULL before using it. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 021a9f9b663..8423dd4ac29 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2023-10-09 Nick Clifton + + PR 30954 + * ldlang.c (map_input_to_output_sections): Check that os is non + NULL before using it. + 2023-10-05 A. Wilcox PR 30905 diff --git a/ld/ldlang.c b/ld/ldlang.c index b40b4a5a0ed..c20247a27d0 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -4198,6 +4198,9 @@ map_input_to_output_sections os); break; case lang_data_statement_enum: + if (os == NULL) + /* This should never happen. */ + FAIL (); /* Make sure that any sections mentioned in the expression are initialized. */ exp_init_os (s->data_statement.exp);