]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: error to print formatted without format
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Wed, 20 Apr 2016 11:33:57 +0000 (14:33 +0300)
committerGitLab <gitlab@git.dovecot.net>
Sat, 7 May 2016 16:22:55 +0000 (19:22 +0300)
This changes the segfault of `doveadm -f formatted ...` to an error.

src/doveadm/doveadm-print-formatted.c

index 87e03c5f199f0f516002c133852592ba116cbaa9..28347eb81d48406c7c3db2542e6e03ac36c13904 100644 (file)
@@ -53,6 +53,9 @@ static void doveadm_print_formatted_flush(void)
 
 static void doveadm_print_formatted_print(const char *value)
 {
+       if (ctx.format == NULL) {
+               i_fatal("formatted formatter cannot be used without a format.");
+       }
        struct var_expand_table *entry = array_idx_modifiable(&ctx.headers, ctx.idx++);
        entry->value = value;