From: Pali Rohár Date: Mon, 25 Oct 2021 13:12:52 +0000 (+0200) Subject: tools: kwboot: Initialize rfds to zero X-Git-Tag: baikal/mips/sdk5.9~15^2^2~60^2~19 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=f26dd35fd146519551402ac94999cb1053e5483d;p=uboot.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;