From: Martti Rannanjärvi Date: Wed, 20 Apr 2016 11:33:57 +0000 (+0300) Subject: doveadm: error to print formatted without format X-Git-Tag: 2.2.25.rc1~213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2812b0ea5d60e092ed3228589cba74de22fa74bf;p=thirdparty%2Fdovecot%2Fcore.git doveadm: error to print formatted without format This changes the segfault of `doveadm -f formatted ...` to an error. --- diff --git a/src/doveadm/doveadm-print-formatted.c b/src/doveadm/doveadm-print-formatted.c index 87e03c5f19..28347eb81d 100644 --- a/src/doveadm/doveadm-print-formatted.c +++ b/src/doveadm/doveadm-print-formatted.c @@ -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;