From 84c111f56b95bc4ef798970d5dc7d82f6cc76239 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 12 Nov 2021 05:23:49 +0000 Subject: [PATCH] aggressively pre-fill the pollfd array with fd=-1 --- usr.bin/ssh/ssh-keyscan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 . * @@ -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) -- 2.20.1