diff options
-rw-r--r-- | sbin/pfctl/parse.y | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 6bde77f951f..a1578f49e8f 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.457 2004/06/26 07:25:16 david Exp $ */ +/* $OpenBSD: parse.y,v 1.458 2004/06/29 17:40:18 frantzen Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -4181,11 +4181,12 @@ expand_rule(struct pf_rule *r, r->af = dst_host->af; if (*interface->ifname) - memcpy(r->ifname, interface->ifname, sizeof(r->ifname)); + strlcpy(r->ifname, interface->ifname, + sizeof(r->ifname)); else if (if_indextoname(src_host->ifindex, ifname)) - memcpy(r->ifname, ifname, sizeof(r->ifname)); + strlcpy(r->ifname, ifname, sizeof(r->ifname)); else if (if_indextoname(dst_host->ifindex, ifname)) - memcpy(r->ifname, ifname, sizeof(r->ifname)); + strlcpy(r->ifname, ifname, sizeof(r->ifname)); else memset(r->ifname, '\0', sizeof(r->ifname)); |