From 1ad2290a27b13194970c68efbf1b95333b0f5892 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 28 May 2018 08:30:57 -0600 Subject: [PATCH] Quiet a clang analyzer warning. It should not be possible for pop_include() to be called when YY_CURRENT_BUFFER is NULL. --- plugins/sudoers/toke.c | 2 +- plugins/sudoers/toke.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c index 991954c30..3274df8cf 100644 --- a/plugins/sudoers/toke.c +++ b/plugins/sudoers/toke.c @@ -4531,7 +4531,7 @@ pop_include(void) FILE *fp; debug_decl(pop_include, SUDOERS_DEBUG_PARSER) - if (idepth == 0) + if (idepth == 0 || YY_CURRENT_BUFFER == NULL) debug_return_bool(false); if (!keepopen) diff --git a/plugins/sudoers/toke.l b/plugins/sudoers/toke.l index 79e659afb..fc0e78cf6 100644 --- a/plugins/sudoers/toke.l +++ b/plugins/sudoers/toke.l @@ -1033,7 +1033,7 @@ pop_include(void) FILE *fp; debug_decl(pop_include, SUDOERS_DEBUG_PARSER) - if (idepth == 0) + if (idepth == 0 || YY_CURRENT_BUFFER == NULL) debug_return_bool(false); if (!keepopen) -- 2.50.1