From 1b3607db00a139df6ff7e24bc6dc7321e07c402c Mon Sep 17 00:00:00 2001 From: jca Date: Tue, 5 Sep 2023 16:01:58 +0000 Subject: [PATCH] Log a dummy "" IP address in the unlikely event that genameinfo(3) fails clang-16 warning reported by robert@, ok tb@ millert@ --- libexec/spamd/spamd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c index 58800238dfc..f2f19b35136 100644 --- a/libexec/spamd/spamd.c +++ b/libexec/spamd/spamd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spamd.c,v 1.160 2023/04/19 12:58:15 jsg Exp $ */ +/* $OpenBSD: spamd.c,v 1.161 2023/09/05 16:01:58 jca Exp $ */ /* * Copyright (c) 2015 Henning Brauer @@ -728,10 +728,8 @@ initcon(struct con *cp, int fd, struct sockaddr *sa) 0 : stutter; error = getnameinfo(sa, sa->sa_len, cp->addr, sizeof(cp->addr), NULL, 0, NI_NUMERICHOST); -#ifdef useless if (error) - errx(1, "%s", gai_strerror(error)); -#endif + strlcpy(cp->addr, "", sizeof(cp->addr)); ctime_r(&t, ctimebuf); ctimebuf[sizeof(ctimebuf) - 2] = '\0'; /* nuke newline */ snprintf(cp->obuf, cp->osize, "220 %s ESMTP %s; %s\r\n", -- 2.20.1