Commit 6affde3b authored by David Gibson's avatar David Gibson Committed by Rusty Russell

net: Fix potential uninitialized use of variables in net_bind()

If the list of addrinfos give to net_bind() contains only IPv4 or only
IPv6 addresses, then the ipv4 and ipv6 variables may be used uninitialized.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent d4975464
......@@ -204,7 +204,8 @@ fail:
int net_bind(const struct addrinfo *addrinfo, int fds[2])
{
const struct addrinfo *ipv6, *ipv4;
const struct addrinfo *ipv6 = NULL;
const struct addrinfo *ipv4 = NULL;
unsigned int num;
if (addrinfo->ai_family == AF_INET)
......
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