Skip to content

Commit

Permalink
managesieve: Fix missing-command check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephanbosch committed Oct 5, 2017
1 parent f59964b commit 6549691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/managesieve/managesieve-client.c
Expand Up @@ -616,7 +616,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 */
Expand Down

0 comments on commit 6549691

Please sign in to comment.