]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: aggressively pre-fill the pollfd array with fd=-1
authorderaadt@openbsd.org <deraadt@openbsd.org>
Fri, 12 Nov 2021 05:23:49 +0000 (05:23 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 17 Nov 2021 21:58:54 +0000 (08:58 +1100)
OpenBSD-Commit-ID: c2a525de8f83c1a04405bd79122c424140552a5b

ssh-keyscan.c

index 4cc3cf7768c4b0ccf887f674fe01de77839113bf..b0c530f3199d05425ec2622f3edb0c5d1f380359 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.141 2021/11/11 15:32:32 deraadt Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.142 2021/11/12 05:23:49 deraadt Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
  *
@@ -773,6 +773,8 @@ main(int argc, char **argv)
                fdlim_set(maxfd);
        fdcon = xcalloc(maxfd, sizeof(con));
        read_wait = xcalloc(maxfd, sizeof(struct pollfd));
+       for (j = 0; j < maxfd; j++)
+               read_wait[j].fd = -1;
 
        for (j = 0; j < fopt_count; j++) {
                if (argv[j] == NULL)