From a14072752818881446de78cfec7aae59c0ada23a Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 20 Jun 2001 15:57:57 +0000 Subject: [PATCH] Fixed #408425 by zeroing sockaddr_in before bind. --- scsh/network1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scsh/network1.c b/scsh/network1.c index e1d2e53..dbc61b9 100644 --- a/scsh/network1.c +++ b/scsh/network1.c @@ -42,7 +42,9 @@ int scheme_bind(int sockfd, int family, scheme_value scheme_name) { struct sockaddr_un name; int scheme_length=STRING_LENGTH(scheme_name); - + + memset(&name, 0, sizeof(name)); + name.sun_family=AF_UNIX; if (scheme_length>=(108-1)) /* save space for \0 */ return(-1); @@ -58,6 +60,8 @@ int scheme_bind(int sockfd, int family, scheme_value scheme_name) { struct sockaddr_in name; + memset(&name, 0, sizeof(name)); + u_long addr=GET_LONG(scheme_name,0); u_short port=htons((u_short)ntohl(GET_LONG(scheme_name,1))); name.sin_family=AF_INET;