projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b35e57
)
ubsan: member access within null pointer of union
author
Alan Modra
<amodra@gmail.com>
Tue, 12 Apr 2022 12:20:09 +0000
(21:50 +0930)
committer
Alan Modra
<amodra@gmail.com>
Wed, 13 Apr 2022 00:37:21 +0000
(10:07 +0930)
Add some nonsense to cover "undefined behaviour".
* ldlang.c (section_for_dot): Avoid UB.
ld/ldlang.c
patch
|
blob
|
history
diff --git
a/ld/ldlang.c
b/ld/ldlang.c
index 1c8d229326cfa3b1647dbba4aea43f98204c6512..f10557af8428ccbca83a57de9ca315f8afff5660 100644
(file)
--- a/
ld/ldlang.c
+++ b/
ld/ldlang.c
@@
-6726,7
+6726,7
@@
section_for_dot (void)
if (stmt->header.type == lang_output_section_statement_enum)
break;
- os =
&stmt->output_section_statement
;
+ os =
stmt ? &stmt->output_section_statement : NULL
;
while (os != NULL
&& !os->after_end
&& (os->bfd_section == NULL