From: Pali Rohár Date: Mon, 25 Oct 2021 13:12:52 +0000 (+0200) Subject: tools: kwboot: Initialize rfds to zero X-Git-Tag: v2025.01-rc5-pxa1908~1652^2~19 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=0a14341cf8f60e6a9ba2edb0802507cbb073e806;p=u-boot.git tools: kwboot: Initialize rfds to zero 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 --- diff --git a/tools/kwboot.c b/tools/kwboot.c index 7e1be29623..695d433b96 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;