From 4a4611f20d0803353d8cda2b86ad86dc1d8fcce5 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 19 Feb 2019 14:57:25 +0100 Subject: [PATCH] Memset 0 server in addition to client --- src/donar_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/donar_server.c b/src/donar_server.c index 18a3a69..00880c4 100644 --- a/src/donar_server.c +++ b/src/donar_server.c @@ -68,6 +68,7 @@ void serv_init_udp_socket(char* port, struct donar_server_ctx* ctx) { fdinfo.cat->name = "udp-read"; fdinfo.other = malloc(sizeof(struct udp_target)); if (fdinfo.other == NULL) goto socket_failed; + memset(fdinfo.other, 0, sizeof(struct udp_target)); sprintf(fdinfo.url, "udp:read:127.0.0.1:%s", port); evt_core_add_fd (&(ctx->evts), &fdinfo); @@ -75,6 +76,7 @@ void serv_init_udp_socket(char* port, struct donar_server_ctx* ctx) { fdinfo.cat->name = "udp-write"; fdinfo.other = malloc(sizeof(struct udp_target)); if (fdinfo.other == NULL) goto socket_failed; + memset(fdinfo.other, 0, sizeof(struct udp_target)); sprintf(fdinfo.url, "udp:write:127.0.0.1:%s", port); evt_core_add_fd (&(ctx->evts), &fdinfo);