summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2021-11-12 05:23:49 +0000
committerDamien Miller <djm@mindrot.org>2021-11-18 08:58:54 +1100
commit06acb04c20ee483fe4757bd12aec870cc4bb1076 (patch)
tree25ea61dd9eecb98d0ff191f4cb2dec26d955a27c /ssh-keyscan.c
parent7eec76793dec06e8f06b6cf71f9473141c69d109 (diff)
downloadopenssh-git-06acb04c20ee483fe4757bd12aec870cc4bb1076.tar.gz
upstream: aggressively pre-fill the pollfd array with fd=-1
OpenBSD-Commit-ID: c2a525de8f83c1a04405bd79122c424140552a5b
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 4cc3cf77..b0c530f3 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -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)