]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: kwboot: Initialize rfds to zero
authorPali Rohár <pali@kernel.org>
Mon, 25 Oct 2021 13:12:52 +0000 (15:12 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:26 +0000 (06:45 +0100)
Explicitly zero out the rfds fd_set with FD_ZERO() before using it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c

index 7e1be296230248622ae03da0f935f16931c24471..695d433b96ee3b178f7d535d3ae800d642773e22 100644 (file)
@@ -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;