diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-11-12 05:23:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-11-12 05:23:50 +0000 |
commit | 55b6f030670948ea66c3924616a85981ba44be58 (patch) | |
tree | 5bb1f0a08ea9f09ed9bb7c2a0993ef06d4a5c0de /usr.bin | |
parent | 4e1906e8965a1304e96c4c94750771aaa95a9915 (diff) |
aggressively pre-fill the pollfd array with fd=-1
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/ssh-keyscan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 19e267b7c85..abde781f144 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/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>. * @@ -753,6 +753,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) |