From 0a14341cf8f60e6a9ba2edb0802507cbb073e806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Mon, 25 Oct 2021 15:12:52 +0200 Subject: tools: kwboot: Initialize rfds to zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly zero out the rfds fd_set with FD_ZERO() before using it. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Reviewed-by: Stefan Roese --- tools/kwboot.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tools') diff --git a/tools/kwboot.c b/tools/kwboot.c index 7e1be29..695d433 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -1151,6 +1151,7 @@ kwboot_terminal(int tty) fd_set rfds; int nfds = 0; + FD_ZERO(&rfds); FD_SET(tty, &rfds); nfds = nfds < tty ? tty : nfds; -- cgit v1.1