diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-05-20 12:18:53 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-05-20 12:18:53 +0000 |
commit | c41ffbca2f28ed5b7b149ac4cf7de4e41ce06512 (patch) | |
tree | a71907896d8f664c399664b9ade4fda6d38e5b41 /sbin | |
parent | 7ef47b98d328b3681626c91cc0581745f7f1fa67 (diff) |
bzero() ifr before use, From: Andrey Matveev <andrushock@korovino.net>
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index 8ade3f6dae4..0e08e2918d8 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.c,v 1.84 2004/04/26 02:50:04 kjc Exp $ */ +/* $OpenBSD: pfctl_altq.c,v 1.85 2004/05/20 12:18:52 henning Exp $ */ /* * Copyright (c) 2002 @@ -1102,6 +1102,7 @@ getifspeed(char *ifname) if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) err(1, "socket"); + bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) errx(1, "getifspeed: strlcpy"); @@ -1123,6 +1124,7 @@ getifmtu(char *ifname) if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) err(1, "socket"); + bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) errx(1, "getifmtu: strlcpy"); |