From: Wilfried Goesgens Date: Tue, 29 May 2012 21:31:31 +0000 (+0200) Subject: locate_host: initialize hostname buffer so we don't send bullshit to the session... X-Git-Tag: v8.12~47 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=0f78ec967e0d2038722dddc0194cf11de59dc623 locate_host: initialize hostname buffer so we don't send bullshit to the session identifier. --- diff --git a/webcit/locate_host.c b/webcit/locate_host.c index 1db2832e9..72a73cca7 100644 --- a/webcit/locate_host.c +++ b/webcit/locate_host.c @@ -22,7 +22,7 @@ void locate_host(StrBuf *tbuf, int client_socket) { struct sockaddr_in6 clientaddr; unsigned int addrlen = sizeof(clientaddr); - char clienthost[NI_MAXHOST]; + char clienthost[NI_MAXHOST] = ""; getpeername(client_socket, (struct sockaddr *)&clientaddr, &addrlen); getnameinfo((struct sockaddr *)&clientaddr, addrlen, clienthost, sizeof(clienthost), NULL, 0, 0);