]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't crash if there's no domain in address
authorTimo Sirainen <tss@iki.fi>
Thu, 17 Jul 2003 14:50:45 +0000 (17:50 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 17 Jul 2003 14:50:45 +0000 (17:50 +0300)
--HG--
branch : HEAD

src/lib-mail/message-address.c

index bd84db4824fb15bf8d21d00346536dd16e28639f..c28c6140f83c6bc741a02b3c90027948f69e140a 100644 (file)
@@ -252,14 +252,14 @@ void message_address_write(string_t *str, const struct message_address *addr)
                } else if ((addr->name == NULL || *addr->name == '\0') &&
                           addr->route == NULL) {
                        i_assert(addr->mailbox != NULL);
-                       i_assert(addr->domain != NULL);
 
                        str_append(str, addr->mailbox);
-                       str_append_c(str, '@');
-                       str_append(str, addr->domain);
+                       if (addr->domain != NULL) {
+                               str_append_c(str, '@');
+                               str_append(str, addr->domain);
+                       }
                } else {
                        i_assert(addr->mailbox != NULL);
-                       i_assert(addr->domain != NULL);
 
                        if (addr->name != NULL) {
                                str_append(str, addr->name);
@@ -272,8 +272,10 @@ void message_address_write(string_t *str, const struct message_address *addr)
                                str_append_c(str, ':');
                        }
                        str_append(str, addr->mailbox);
-                       str_append_c(str, '@');
-                       str_append(str, addr->domain);
+                       if (addr->domain != NULL) {
+                               str_append_c(str, '@');
+                               str_append(str, addr->domain);
+                       }
                        str_append_c(str, '>');
                }