Skip to content

Commit

Permalink
plugins: imap-filter-sieve: Fix assertion panic occurring after scrip…
Browse files Browse the repository at this point in the history
…t compile error.

Compile errors occurring for Sieve scripts uploaded in multiple TCP frames were
not handled correctly.
  • Loading branch information
stephanbosch authored and sirainen committed Aug 29, 2018
1 parent c7a83a3 commit 41b9adc
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/plugins/imap-filter-sieve/cmd-filter-sieve.c
Expand Up @@ -316,18 +316,11 @@ cmd_filter_sieve_script_parse_value(struct client_command_context *cmd)
if (ctx->script_input != NULL) {
if ((ret=cmd_filter_sieve_script_read_stream(ctx)) == 0)
return FALSE;
if (ret < 0) {
imap_filter_deinit(ctx);
return TRUE;
}

imap_parser_reset(ctx->parser);
cmd->func = imap_filter_search;
return imap_filter_search(cmd);
} else {
if ((ret=cmd_filter_sieve_script_parse_value_arg(ctx)) == 0)
return FALSE;
}

if ((ret=cmd_filter_sieve_script_parse_value_arg(ctx)) == 0)
return FALSE;
if (ret < 0) {
/* already sent the error to client */ ;
imap_filter_deinit(ctx);
Expand Down

0 comments on commit 41b9adc

Please sign in to comment.