From f9eda178d03a16b6915deafaa434c17efe97e9a5 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Tue, 28 Jun 2016 23:44:12 +0200
Subject: [PATCH] lib-sieve: if command: Made static analyzer happier.

Added assertion to validation function.
---
 src/lib-sieve/cmd-if.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib-sieve/cmd-if.c b/src/lib-sieve/cmd-if.c
index d8cabad18..19fea10e7 100644
--- a/src/lib-sieve/cmd-if.c
+++ b/src/lib-sieve/cmd-if.c
@@ -138,7 +138,10 @@ static bool cmd_if_validate
 static bool cmd_elsif_validate
 (struct sieve_validator *valdtr, struct sieve_command *cmd)
 {
-	struct sieve_command *prev = sieve_command_prev(cmd);
+	struct sieve_command *prev;
+
+	i_assert(cmd != NULL);
+	prev = sieve_command_prev(cmd);
 
 	/* Check valid command placement */
 	if ( prev == NULL ||
-- 
GitLab