From 00d21b9ae0e379caba54720c71f200596100c8f0 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 2 Feb 2021 07:43:22 -0800 Subject: Assert TCP_INFO size before checking content Also sync syscall test expectations on Fuchisa. PiperOrigin-RevId: 355163492 --- test/syscalls/linux/socket_ip_tcp_generic.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index 2c8e5f6f3..579e824cd 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -88,6 +88,7 @@ TEST_P(TCPSocketPairTest, CheckTcpInfoFields) { socklen_t optLen = sizeof(opt); ASSERT_THAT(getsockopt(sockets->first_fd(), SOL_TCP, TCP_INFO, &opt, &optLen), SyscallSucceeds()); + ASSERT_EQ(optLen, sizeof(opt)); // Validates the received tcp_info fields. EXPECT_EQ(opt.tcpi_ca_state, TCP_CA_OPEN); -- cgit v1.2.3