From 1bac4dc9a277a359de77b2780d50466de06a39ea Mon Sep 17 00:00:00 2001 From: Davidson Francis Date: Tue, 23 Jul 2024 22:21:54 -0300 Subject: [PATCH] Bug Fix: Missing clilen initialization --- syslog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syslog.c b/syslog.c index d40784d..9af6b10 100644 --- a/syslog.c +++ b/syslog.c @@ -63,11 +63,12 @@ int syslog_create_udp_socket(void) /**/ int syslog_enqueue_new_upd_msg(int fd) { - struct sockaddr_storage cli; + struct sockaddr_storage cli = {0}; char msg[MSG_MAX] = {0}; socklen_t clilen; ssize_t ret; + clilen = sizeof(cli); ret = recvfrom(fd, msg, sizeof msg - 1, 0, (struct sockaddr*)&cli, &clilen);