summaryrefslogtreecommitdiff
path: root/usr.sbin/pppctl
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1997-12-21 02:26:57 +0000
committerbrian <brian@cvs.openbsd.org>1997-12-21 02:26:57 +0000
commitef6b2fdc3e2b6c6f9e241238b13c693af86b670d (patch)
treeed5a23e2079c6c07fa57b5fa5da620f4f3b85453 /usr.sbin/pppctl
parentf48de97edd8ff2784f80e8e4f9c741a41466179d (diff)
Zero struct sockaddr_??s before filling them in.
Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>
Diffstat (limited to 'usr.sbin/pppctl')
-rw-r--r--usr.sbin/pppctl/pppctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pppctl/pppctl.c b/usr.sbin/pppctl/pppctl.c
index 15c591fc1dc..d374f3c7c6d 100644
--- a/usr.sbin/pppctl/pppctl.c
+++ b/usr.sbin/pppctl/pppctl.c
@@ -1,5 +1,5 @@
/*
- * $Id: pppctl.c,v 1.3 1997/12/18 00:30:44 brian Exp $
+ * $Id: pppctl.c,v 1.4 1997/12/21 02:26:56 brian Exp $
*/
#include <sys/types.h>
@@ -210,6 +210,7 @@ main(int argc, char **argv)
sock = (struct sockaddr *)&ifsun;
socksz = sizeof ifsun;
+ memset(&ifsun, '\0', sizeof ifsun);
ifsun.sun_len = strlen(argv[arg]);
if (ifsun.sun_len > sizeof ifsun.sun_path - 1) {
fprintf(stderr, "%s: Path too long\n", argv[arg]);
@@ -239,6 +240,7 @@ main(int argc, char **argv)
socksz = sizeof ifsin;
hlen = strlen(host);
+ memset(&ifsin, '\0', sizeof ifsin);
if (strspn(host, "0123456789.") == hlen) {
if (!inet_aton(host, &ifsin.sin_addr)) {
fprintf(stderr, "Cannot translate %s\n", host);