From: jca Date: Tue, 5 Sep 2023 16:01:58 +0000 (+0000) Subject: Log a dummy "" IP address in the unlikely event that genameinfo(3) fails X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1b3607db00a139df6ff7e24bc6dc7321e07c402c;p=openbsd Log a dummy "" IP address in the unlikely event that genameinfo(3) fails clang-16 warning reported by robert@, ok tb@ millert@ --- 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",