From 9fc237c32b7977f2d1eeffcf3fd4751c0255c9c3 Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 23 Apr 2018 07:15:49 +0000 Subject: [PATCH] Correct size for allocation and bzero of fdsr. MFC after: 2 weeks --- usr.sbin/syslogd/syslogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 1f9dfc17aa11..fa5757138f82 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -744,7 +744,7 @@ main(int argc, char *argv[]) fdsrmax = sl->sl_socket; } fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS), - sizeof(fd_mask)); + sizeof(*fdsr)); if (fdsr == NULL) errx(1, "calloc fd_set"); @@ -763,7 +763,7 @@ main(int argc, char *argv[]) } bzero(fdsr, howmany(fdsrmax+1, NFDBITS) * - sizeof(fd_mask)); + sizeof(*fdsr)); STAILQ_FOREACH(sl, &shead, next) { if (sl->sl_socket != -1 && sl->sl_recv != NULL)