In t_inetd, zero out l_inaddr before filling it in, as is relatively
authorGreg Hudson <ghudson@mit.edu>
Wed, 21 Apr 2010 23:14:49 +0000 (23:14 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 21 Apr 2010 23:14:49 +0000 (23:14 +0000)
common in networking code.  Silences a Coverity defect.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23916 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/dejagnu/t_inetd.c

index dbee2838df746b4e9f323d8cd67c2fef90d5f22d..72d51fd7f6fdb4e3d60c11d220880d8370d9d47b 100644 (file)
@@ -46,6 +46,7 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
@@ -97,6 +98,7 @@ main(argc, argv)
     (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
                       sizeof (one));
 
+    memset(&l_inaddr, 0, sizeof(l_inaddr));
     l_inaddr.sin_family = AF_INET;
     l_inaddr.sin_addr.s_addr = 0;
     l_inaddr.sin_port = port;