diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-01-03 21:53:36 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-01-03 21:53:36 +0000 |
commit | a720af15c5be43fc89e4b723cded2da498f03ed4 (patch) | |
tree | 679e239eafd69d87e4c65000af861364ccb1c0df /sbin/pfctl | |
parent | 0d9ba8b008e70f9ee63a9bf5d1951147f95472c0 (diff) |
Initialize hints addrinfo in a safe way.
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/pfctl_table.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 4524ac9176d..21c023c726d 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_table.c,v 1.2 2003/01/03 21:43:11 deraadt Exp $ */ +/* $OpenBSD: pfctl_table.c,v 1.3 2003/01/03 21:53:35 cedric Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -458,9 +458,11 @@ void _append_addr(char *s, int test) { char buf[_BUF_SIZE], *p, *q; - struct addrinfo *res, *ai, hints = { 0, 0, SOCK_DGRAM }; + struct addrinfo *res, *ai, hints; int not = (*s == '!'), net = -1, rv; + bzero(&hints, sizeof(hints)); + hints.ai_socktype = SOCK_DGRAM; if (strlen(s) >= _BUF_SIZE) { fprintf(stderr, "%s: address too long (%ld bytes)\n", __progname, (long)strlen(s)); |