aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2000-05-17 22:58:52 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-05-17 22:58:52 +0800
commit4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c (patch)
tree82570dbb01852eb07087e113c6335294e2e90cc4 /camel
parentd4f3e3b651f787cd418d3055ceb12e1193f27aad (diff)
downloadgsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar.gz
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar.bz2
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar.lz
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar.xz
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.tar.zst
gsoc2013-evolution-4f7a55138c376aa0fb09d4b37d7dd7dd2449ed2c.zip
error checking on gethostbyaddr() in providers/smtp/camel-smtp-transport.c
svn path=/trunk/; revision=3104
Diffstat (limited to 'camel')
-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,