From 7aabfac436fc8bf87b7424a62bd5bb13593c4c77 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Sat, 8 Jul 2017 10:27:52 +0200
Subject: [PATCH] sieve-tools: Terminate with a fatal error when script cannot
 be compiled/opened.

Rather than continuing with binary == NULL, causing a segfault.
---
 src/lib-sieve-tool/sieve-tool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib-sieve-tool/sieve-tool.c b/src/lib-sieve-tool/sieve-tool.c
index 145490231..f4682069b 100644
--- a/src/lib-sieve-tool/sieve-tool.c
+++ b/src/lib-sieve-tool/sieve-tool.c
@@ -537,7 +537,7 @@ struct sieve_binary *sieve_tool_script_compile
 
 	if ( (sbin = sieve_compile
 		(svinst, filename, name, ehandler, 0, NULL)) == NULL )
-		i_error("failed to compile sieve script '%s'", filename);
+		i_fatal("failed to compile sieve script '%s'", filename);
 
 	sieve_error_handler_unref(&ehandler);
 
-- 
GitLab