From 439f676d45d75f59f47a000a6adca8e9fe6a6e4e Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Sun, 16 Apr 2017 10:49:56 +0200 Subject: [PATCH] Fix TokTok/c-toxcore#535 --- toxcore/TCP_client.h | 2 +- toxcore/network.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toxcore/TCP_client.h b/toxcore/TCP_client.h index 8a698869..90002214 100644 --- a/toxcore/TCP_client.h +++ b/toxcore/TCP_client.h @@ -58,7 +58,7 @@ enum { }; typedef struct { uint8_t status; - Socket sock; + Socket sock; #ifdef HAVE_LIBEV struct { ev_io listener; diff --git a/toxcore/network.c b/toxcore/network.c index f74363e6..a68e91f4 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -674,6 +674,8 @@ Networking_Core *new_networking_ex(Logger *log, IP ip, uint16_t port_from, uint1 struct sockaddr_storage addr; size_t addrsize; + memset(&addr, 0, sizeof(struct sockaddr_storage)); + if (temp->family == AF_INET) { struct sockaddr_in *addr4 = (struct sockaddr_in *)&addr;