ossp-pkg/lmtp2nntp/sa.c 1.8 -> 1.9
--- sa.c 2001/09/04 09:46:06 1.8
+++ sa.c 2001/09/07 10:26:08 1.9
@@ -110,6 +110,7 @@
if ((nPath = strlen(cpPath)) >= (sizeof(sau.sun_path)-1))
return NULL;
nProto = 0;
+ memset(&sau, 0, sizeof(sau));
sau.sun_family = AF_LOCAL;
memcpy(sau.sun_path, cpPath, nPath + 1);
sa = (struct sockaddr *)&sau;
@@ -147,6 +148,11 @@
nPort = ntohs(se->s_port);
}
+ /* mandatory initialization */
+ memset(&sa4, 0, sizeof(sa4));
+#ifdef AF_INET6
+ memset(&sa6, 0, sizeof(sa6));
+#endif
/* resolve host */
if (inet_pton(AF_INET, cpHost, &sa4.sin_addr.s_addr) == 1) {
sa4.sin_family = AF_INET;
|
|