mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
selftests: net: netlink-dumps: validation checks
The sanity checks are going to get silently cast to unsigned and always pass. Cast the sizeof to signed size. Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241115003248.733862-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0de6a472c3
commit
357c52ff86
|
|
@ -56,10 +56,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user