selftests/tls: Add {} to avoid static checker warning
authorKees Cook <keescook@chromium.org>
Thu, 27 May 2021 03:27:19 +0000 (20:27 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 8 Jun 2021 00:39:29 +0000 (18:39 -0600)
This silences a static checker warning due to the unusual macro
construction of EXPECT_*() by adding explicit {}s around the enclosing
while loop.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/net/tls.c

index 426d078..7119f8e 100644 (file)
@@ -418,8 +418,9 @@ TEST_F(tls, sendmsg_large)
                EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
        }
 
-       while (recvs++ < sends)
+       while (recvs++ < sends) {
                EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+       }
 
        free(mem);
 }