From 8ad076b280659245702f943b00188589820aafeb Mon Sep 17 00:00:00 2001 From: Nigel Metheringham Date: Thu, 18 Oct 2007 12:00:43 +0000 Subject: [PATCH] Defend against bad data from gethostbyaddr(). Fixes bug #619 --- doc/doc-txt/ChangeLog | 4 +++- src/src/host.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 63abba29c..fa7a84f14 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.533 2007/09/28 13:04:16 tom Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.534 2007/10/18 12:00:43 nm4 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -19,6 +19,8 @@ NM/01 Bugzilla 592: --help option is handled incorrectly if exim is invoked SC/01 Added the -bylocaldomain option to eximstats. +NM/02 Bugzilla 619: Defended against bad data coming back from gethostbyaddr + Exim version 4.68 ----------------- diff --git a/src/src/host.c b/src/src/host.c index b353fe2db..18821035c 100644 --- a/src/src/host.c +++ b/src/src/host.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/host.c,v 1.28 2007/01/08 10:50:18 ph10 Exp $ */ +/* $Cambridge: exim/src/src/host.c,v 1.29 2007/10/18 12:01:00 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1502,7 +1502,7 @@ if (hosts == NULL) treat this as non-existent. In some operating systems, this is returned as an empty string; in others as a single dot. */ -if (hosts->h_name[0] == 0 || hosts->h_name[0] == '.') +if (hosts->h_name == NULL || hosts->h_name[0] == 0 || hosts->h_name[0] == '.') { HDEBUG(D_host_lookup) debug_printf("IP address lookup yielded an empty name: " "treated as non-existent host name\n"); -- 2.25.1