ubsan: member access within null pointer of union
Add some nonsense to cover "undefined behaviour". * ldlang.c (section_for_dot): Avoid UB.
This commit is contained in:
parent
1b35e577c3
commit
10c0005660
1 changed files with 1 additions and 1 deletions
|
@ -6726,7 +6726,7 @@ section_for_dot (void)
|
||||||
if (stmt->header.type == lang_output_section_statement_enum)
|
if (stmt->header.type == lang_output_section_statement_enum)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
os = &stmt->output_section_statement;
|
os = stmt ? &stmt->output_section_statement : NULL;
|
||||||
while (os != NULL
|
while (os != NULL
|
||||||
&& !os->after_end
|
&& !os->after_end
|
||||||
&& (os->bfd_section == NULL
|
&& (os->bfd_section == NULL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue