From c41ffbca2f28ed5b7b149ac4cf7de4e41ce06512 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 20 May 2004 12:18:53 +0000 Subject: bzero() ifr before use, From: Andrey Matveev --- sbin/pfctl/pfctl_altq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sbin/pfctl/pfctl_altq.c') 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"); -- cgit v1.2.3