aboutsummaryrefslogtreecommitdiff
path: root/ld
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
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')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ldlang.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 021a9f9..8423dd4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2023-10-09 Nick Clifton <nickc@redhat.com>
+
+ PR 30954
+ * ldlang.c (map_input_to_output_sections): Check that os is non
+ NULL before using it.
+
2023-10-05 A. Wilcox <awilfox@adelielinux.org>
PR 30905
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);