aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index fbd9dcb092..287ee7aab6 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-17 Jeffrey Stedfast <fejj@stampede.org>
+
+ * providers/smtp/camel-smtp-transport.c: (smtp_helo): Error
+ checking on gethostbyaddr() eliminating a possible segfault.
+
2000-05-16 NotZed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-folder.c (mbox_delete_message_by_uid):
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index f7de36f571..5b9e858a65 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -473,9 +473,9 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
/* hiya server! how are you today? */
if (smtp_is_esmtp)
- cmdbuf = g_strdup_printf ("EHLO %s\r\n", host->h_name);
+ cmdbuf = g_strdup_printf ("EHLO %s\r\n", host && host->h_name ? host->h_name : inet_ntoa(localaddr.sin_addr));
else
- cmdbuf = g_strdup_printf ("HELO %s\r\n", host->h_name);
+ cmdbuf = g_strdup_printf ("HELO %s\r\n", host && host->h_name ? host->h_name : inet_ntoa(localaddr.sin_addr));
if ( camel_stream_write (transport->ostream, cmdbuf, strlen(cmdbuf), ex) == -1) {
g_free(cmdbuf);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,