From 37e8f71c0aa7df7955e355c75adbc143839c30da Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Thu, 5 Oct 2017 23:29:25 +0200
Subject: [PATCH] managesieve: Fix missing-command check

Mirrors imap fix in Dovecot: 42149f48624b82fdf9631c256497580154c2e412

It's impossible for the command's pointer to be NULL at this point.
Previously, the command_find() would have returned NULL, but this check
presumably short-circuits that search in the trivial case, so has some
real use.

Problem now found by GCC 7.
---
 src/managesieve/managesieve-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/managesieve/managesieve-client.c b/src/managesieve/managesieve-client.c
index 795e4c525..47cccd402 100644
--- a/src/managesieve/managesieve-client.c
+++ b/src/managesieve/managesieve-client.c
@@ -605,7 +605,7 @@ static bool client_handle_input(struct client_command_context *cmd)
 		managesieve_refresh_proctitle();
 	}
 
-	if (cmd->name == '\0') {
+	if (cmd->name[0] == '\0') {
 		/* command not given - cmd_func is already NULL. */
 	} else {
 		/* find the command function */
-- 
GitLab