aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2023-10-09 17:13:25 +0100
committerNick Clifton <nickc@redhat.com>2023-10-09 17:13:25 +0100
commitee1cb49e5a9de8049d887abd8c9f2eff1851147e (patch)
tree591385182b7b217c52571dec1c941fd4d59ca82d /ld/ldlang.c
parentcb0f1baf44a4de4506283502df68cad3b7780e1d (diff)
downloadgdb-ee1cb49e5a9de8049d887abd8c9f2eff1851147e.zip
gdb-ee1cb49e5a9de8049d887abd8c9f2eff1851147e.tar.gz
gdb-ee1cb49e5a9de8049d887abd8c9f2eff1851147e.tar.bz2
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index b40b4a5..c20247a 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);