aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2023-10-09 17:52:39 +0100
committerNick Clifton <nickc@redhat.com>2023-10-09 17:52:39 +0100
commit1b334e27f8410c7fbe3417023258eb9e03ec9592 (patch)
treed038ef33d9ce58e516e16c603d9d60a36810ef7b /ld/ldlex.l
parentee1cb49e5a9de8049d887abd8c9f2eff1851147e (diff)
downloadgdb-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/ldlex.l')
-rw-r--r--ld/ldlex.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 435172c..94b2ea7 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -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)
{