diff options
author | Nick Clifton <nickc@redhat.com> | 2023-10-09 17:52:39 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-10-09 17:52:39 +0100 |
commit | 1b334e27f8410c7fbe3417023258eb9e03ec9592 (patch) | |
tree | d038ef33d9ce58e516e16c603d9d60a36810ef7b /ld | |
parent | ee1cb49e5a9de8049d887abd8c9f2eff1851147e (diff) | |
download | gdb-1b334e27f8410c7fbe3417023258eb9e03ec9592.zip gdb-1b334e27f8410c7fbe3417023258eb9e03ec9592.tar.gz gdb-1b334e27f8410c7fbe3417023258eb9e03ec9592.tar.bz2 |
Fix: Null pointer dereference in ldlex.l
PR 30951
* ldlex.l (yy_input): Check for YY_CURRENT_BUFFER being NULL.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 3 | ||||
-rw-r--r-- | ld/ldlex.l | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8423dd4..05b88ee 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,8 @@ 2023-10-09 Nick Clifton <nickc@redhat.com> + PR 30951 + * ldlex.l (yy_input): Check for YY_CURRENT_BUFFER being NULL. + PR 30954 * ldlang.c (map_input_to_output_sections): Check that os is non NULL before using it. @@ -668,7 +668,7 @@ static int yy_input (char *buf, int max_size) { int result = 0; - if (YY_CURRENT_BUFFER->yy_input_file) + if (YY_CURRENT_BUFFER != NULL && YY_CURRENT_BUFFER->yy_input_file) { if (yyin) { |