summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2021-02-12 10:56:15 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-12 10:58:17 -0800
commita6d813ad55ae80a2c4173fc3fd3961236327cf8b (patch)
tree73083c4ab7d64cc57c3ce94bfd4861de68a15aa9
parent845d0a65f449ade1952568b5fc120e7cb8cd709f (diff)
tests: getsockname expects that addrlen will be initialized
PiperOrigin-RevId: 357224877
-rw-r--r--test/syscalls/linux/udp_socket.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/syscalls/linux/udp_socket.cc b/test/syscalls/linux/udp_socket.cc
index 50f589708..16eeeb5c6 100644
--- a/test/syscalls/linux/udp_socket.cc
+++ b/test/syscalls/linux/udp_socket.cc
@@ -2131,8 +2131,8 @@ TEST(UdpInet6SocketTest, ConnectInet4Sockaddr) {
reinterpret_cast<const struct sockaddr*>(&connect_sockaddr),
sizeof(sockaddr_in)),
SyscallSucceeds());
- socklen_t len;
sockaddr_storage sockname;
+ socklen_t len = sizeof(sockaddr_storage);
ASSERT_THAT(getsockname(sock_.get(),
reinterpret_cast<struct sockaddr*>(&sockname), &len),
SyscallSucceeds());