Commit 61ad51b6 authored by Marek Vavruša's avatar Marek Vavruša

daemon: fixed garbage read when getsockname fails

parent 894165c9
Pipeline #31585 passed with stages
in 6 minutes and 46 seconds
......@@ -19,6 +19,7 @@ ifeq ($(AMALG), yes)
kresd.amalg.c: daemon/lua/sandbox.inc daemon/lua/config.inc
else
daemon/engine.o: daemon/lua/sandbox.inc daemon/lua/config.inc
kresd-lint: daemon/lua/sandbox.inc daemon/lua/config.inc
endif
# Installed FFI bindings
......
......@@ -248,7 +248,7 @@ int network_listen_fd(struct network *net, int fd, bool use_tls)
return kr_error(EBADF);
}
/* Extract local address for this socket. */
struct sockaddr_storage ss;
struct sockaddr_storage ss = { .ss_family = AF_UNSPEC };
socklen_t addr_len = sizeof(ss);
ret = getsockname(fd, (struct sockaddr *)&ss, &addr_len);
if (ret != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment