From: Stanislav Malyshev Date: Tue, 31 Jul 2007 00:31:10 +0000 (+0000) Subject: sometimes c-client lib returns non-null entry with null host X-Git-Tag: php-5.2.4RC1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb927452c9b190766f256626ac4f73e458d4db00;p=php sometimes c-client lib returns non-null entry with null host --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 3197ada50a..0a80eaf3a7 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3407,7 +3407,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * addr = NULL; rfc822_parse_adrlist(&addr, tempMailTo, NULL); while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { + if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; } else { bufferTo = safe_erealloc(bufferTo, bt_len, 1, strlen(addr->mailbox)); @@ -3436,7 +3436,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * addr = NULL; rfc822_parse_adrlist(&addr, tempMailTo, NULL); while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { + if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; } else { bufferCc = safe_erealloc(bufferCc, bt_len, 1, strlen(addr->mailbox)); @@ -3462,7 +3462,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * addr = NULL; rfc822_parse_adrlist(&addr, tempMailTo, NULL); while (addr) { - if (strcmp(addr->host, ERRHOST) == 0) { + if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; } else { bufferBcc = safe_erealloc(bufferBcc, bt_len, 1, strlen(addr->mailbox));