[PATCH net-next] selftests: net: netlink-dumps: validation checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The sanity checks are going to get silently cast to unsigned
and always pass. Cast the sizeof to signed size.

Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
---
CC: linux-kselftest@xxxxxxxxxxxxxxx
---
 tools/testing/selftests/net/netlink-dumps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/netlink-dumps.c b/tools/testing/selftests/net/netlink-dumps.c
index 195febbf6a61..07423f256f96 100644
--- a/tools/testing/selftests/net/netlink-dumps.c
+++ b/tools/testing/selftests/net/netlink-dumps.c
@@ -185,10 +185,10 @@ TEST(test_sanity)
 	ASSERT_EQ(n, sizeof(dump_policies));
 
 	n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
-	ASSERT_GE(n, sizeof(struct nlmsghdr));
+	ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
 
 	n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
-	ASSERT_GE(n, sizeof(struct nlmsghdr));
+	ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
 
 	close(netlink_sock);
 }
-- 
2.47.0





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux