dovecot-2.1: doveadm fetch hdr.*.adddress*: Don't crash when pri...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jan 26 21:43:38 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/afeabe28a499
changeset: 14002:afeabe28a499
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jan 26 21:43:27 2012 +0200
description:
doveadm fetch hdr.*.adddress*: Don't crash when printing groups.

diffstat:

 src/doveadm/doveadm-mail-fetch.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r a6a787f0aba1 -r afeabe28a499 src/doveadm/doveadm-mail-fetch.c
--- a/src/doveadm/doveadm-mail-fetch.c	Thu Jan 26 21:25:39 2012 +0200
+++ b/src/doveadm/doveadm-mail-fetch.c	Thu Jan 26 21:43:27 2012 +0200
@@ -164,10 +164,15 @@
 			if (add_lf)
 				str_append_c(str, '\n');
 			if (strcmp(filter, "address") == 0) {
-				str_printfa(str, "%s@%s",
-					    addr->mailbox, addr->domain);
+				if (addr->mailbox != NULL)
+					str_append(str, addr->mailbox);
+				if (addr->domain != NULL) {
+					str_append_c(str, '@');
+					str_append(str, addr->domain);
+				}
 			} else {
-				str_append(str, addr->name);
+				if (addr->name != NULL)
+					str_append(str, addr->name);
 			}
 			add_lf = TRUE;
 		}


More information about the dovecot-cvs mailing list