From: claudio Date: Tue, 31 Aug 2021 15:18:53 +0000 (+0000) Subject: memset the pfds array in the poll loop and not only at the start. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=72429ad6b72d36e3c8788f95a731717ebc1ee7ae;p=openbsd memset the pfds array in the poll loop and not only at the start. --- diff --git a/usr.sbin/rpki-client/rrdp.c b/usr.sbin/rpki-client/rrdp.c index 60681ace736..d2fb0633738 100644 --- a/usr.sbin/rpki-client/rrdp.c +++ b/usr.sbin/rpki-client/rrdp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp.c,v 1.10 2021/06/14 10:01:23 claudio Exp $ */ +/* $OpenBSD: rrdp.c,v 1.11 2021/08/31 15:18:53 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -509,13 +509,12 @@ proc_rrdp(int fd) if (pledge("stdio recvfd", NULL) == -1) err(1, "pledge"); - memset(&pfds, 0, sizeof(pfds)); - msgbuf_init(&msgq); msgq.fd = fd; for (;;) { i = 1; + memset(&pfds, 0, sizeof(pfds)); TAILQ_FOREACH(s, &states, entry) { if (i >= MAX_SESSIONS + 1) { /* not enough sessions, wait for better times */