summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-12-07 15:33:43 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-12-07 15:33:43 +0000
commitbef02f94761c7f7a003178056c11d51a8ada33ce (patch)
tree5817a7f1e92b1c2388528df9cbfb25fe88a2a177 /usr.sbin
parent89735e3c42f6cfdfa1aca639235396aa6dd53fe0 (diff)
Avoid dereferencing a null pointer when logging a DNS lookup failure.
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/mta.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index edb308fe352..8db9bce1452 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.77 2009/11/16 09:40:43 jacekm Exp $ */
+/* $OpenBSD: mta.c,v 1.78 2009/12/07 15:33:42 jsing Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -877,10 +877,12 @@ mta_status(struct mta_session *s, const char *fmt, ...)
/* remove queue entry */
if (*status == '2' || *status == '5' || *status == '6') {
- log_info("%s: to=<%s@%s>, delay=%d, relay=%s [%s], stat=%s (%s)",
+ log_info("%s: to=<%s@%s>, delay=%d, relay=%s [%s],"
+ " stat=%s (%s)",
m->message_id, m->recipient.user,
m->recipient.domain, time(NULL) - m->creation,
- relay->fqdn, ss_to_text(&relay->sa),
+ relay ? relay->fqdn : "(none)",
+ relay ? ss_to_text(&relay->sa) : "",
*status == '2' ? "Sent" :
*status == '5' ? "RemoteError" : "LocalError",
m->session_errorline + 4);