Fix namebuff overwrite leading to wrong log after socket bind warning.

This commit is contained in:
Simon Kelley committed 2022-09-09 15:57:39 +01:00
1 parent 1d53d958bb
commit e518e87533
1 file changed
+3 -3
+3 -3
View File
@@ -2439,12 +2439,12 @@ static int random_sock(struct server *s)
return fd;
if (s->interface[0] == 0)
(void)prettyprint_addr(&s->source_addr, daemon->namebuff);
(void)prettyprint_addr(&s->source_addr, daemon->addrbuff);
else
strcpy(daemon->namebuff, s->interface);
safe_strncpy(daemon->addrbuff, s->interface, ADDRSTRLEN);
my_syslog(LOG_ERR, _("failed to bind server socket to %s: %s"),
daemon->namebuff, strerror(errno));
daemon->addrbuff, strerror(errno));
close(fd);
}