Skip to contentSkip to conversation

selftests/tls: Add {} to avoid static checker warning

PATCH New Kees Cook 1 participant 1 message Jan 8, 2019

Subsystems (3)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 selftests/tls: Add {} to avoid static checker warning

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 at oracle.com>
Fixes 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by Kees Cook <keescook at chromium.org>

---
I think this will fix it?

---
 tools/testing/selftests/net/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/net/tls.c +2 -1
index fac68d710f35..e1472b8b53f3 100644
@@ -202,8 +202,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);
 }
Signature · 5 lines
2.17.1


-- 
Kees Cook