]> granicus.if.org Git - sudo/commitdiff
Quiet a clang analyzer warning. It should not be possible for
authorTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 28 May 2018 14:30:57 +0000 (08:30 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 28 May 2018 14:30:57 +0000 (08:30 -0600)
pop_include() to be called when YY_CURRENT_BUFFER is NULL.

plugins/sudoers/toke.c
plugins/sudoers/toke.l

index 991954c303851af71e2dfd131317955feb488275..3274df8cfb76566dbe55ac3c4f0adb74992c08da 100644 (file)
@@ -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)
index 79e659afbf4e0d899fa7892539c611d10771773c..fc0e78cf69c231bca25dd03232d5183c5b1c4947 100644 (file)
@@ -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)