summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-02-13 13:27:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-02-13 13:31:31 +0100
commitf391fdd8e0fbaf3749819cfa0cd9b478f3630a7d (patch)
tree65931a5005c4661b69e0e5e67db912b84c69fab1 /src
parent76c358ccfea07fe8447359db00488e1bd13e1b73 (diff)
scanner: use list_is_first() from scanner_pop_indesc()
!list_empty() always stands true since the list is never empty when calling scanner_pop_indesc(). Check for list_is_first() which actually tells us this is the initial input file, hence, state->indesc is set to NULL. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/scanner.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scanner.l b/src/scanner.l
index ed29833b..3932883b 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -678,7 +678,7 @@ static void scanner_push_indesc(struct parser_state *state,
static void scanner_pop_indesc(struct parser_state *state)
{
- if (!list_empty(&state->indesc_list)) {
+ if (!list_is_first(&state->indesc->list, &state->indesc_list)) {
state->indesc = list_entry(state->indesc->list.prev,
struct input_descriptor, list);
} else {