mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-15 20:05:46 +08:00
Fix potentially undefined behaviour in the linker when parsing input statements.
* ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Check for an empty file chain before examining the first input statement.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2019-11-21 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Check for an empty
|
||||
file chain before examining the first input statement.
|
||||
|
||||
2019-11-21 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 46
|
||||
|
@ -574,7 +574,7 @@ extern asection *section_for_dot
|
||||
|
||||
#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
|
||||
lang_input_statement_type *statement; \
|
||||
for (statement = &file_chain.head->input_statement; \
|
||||
for (statement = file_chain.head == NULL ? NULL : &file_chain.head->input_statement; \
|
||||
statement != NULL; \
|
||||
statement = statement->next)
|
||||
|
||||
|
Reference in New Issue
Block a user