diff options
-rw-r--r-- | test/syscalls/linux/socket_ip_tcp_generic.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index 0b76280a7..a43cf9bce 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -679,7 +679,7 @@ TEST_P(TCPSocketPairTest, SetCongestionControlFailsForUnsupported) { auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); char old_cc[kTcpCaNameMax]; - socklen_t optlen; + socklen_t optlen = sizeof(old_cc); ASSERT_THAT(getsockopt(sockets->first_fd(), IPPROTO_TCP, TCP_CONGESTION, &old_cc, &optlen), SyscallSucceedsWithValue(0)); @@ -690,6 +690,7 @@ TEST_P(TCPSocketPairTest, SetCongestionControlFailsForUnsupported) { SyscallFailsWithErrno(ENOENT)); char got_cc[kTcpCaNameMax]; + optlen = sizeof(got_cc); ASSERT_THAT(getsockopt(sockets->first_fd(), IPPROTO_TCP, TCP_CONGESTION, &got_cc, &optlen), SyscallSucceedsWithValue(0)); |