diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-01-05 02:23:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-01-05 02:23:40 +0000 |
commit | 498778d14a0fde7e926ede29ac87301493081b5a (patch) | |
tree | 5cc07799cc640f5ad9807a648557f6b769e5c235 /sys/net | |
parent | 52146ddc1cbd014bda22c456edbf3aa979107c8d (diff) |
bzero after malloc; ok dhartmei
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf_ioctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index ff21f02c517..b4cb92292b4 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.161 2005/12/10 14:41:07 krw Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.162 2006/01/05 02:23:39 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -355,6 +355,7 @@ pf_find_or_create_ruleset(const char *path) if (ruleset != NULL) return (ruleset); p = (char *)malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + bzero(p, MAXPATHLEN); strlcpy(p, path, MAXPATHLEN); while (parent == NULL && (q = strrchr(p, '/')) != NULL) { *q = 0; @@ -473,6 +474,7 @@ pf_anchor_setup(struct pf_rule *r, const struct pf_ruleset *s, if (!name[0]) return (0); path = (char *)malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + bzero(path, MAXPATHLEN); if (name[0] == '/') strlcpy(path, name + 1, MAXPATHLEN); else { @@ -530,6 +532,7 @@ pf_anchor_copyout(const struct pf_ruleset *rs, const struct pf_rule *r, int i; a = (char *)malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + bzero(a, MAXPATHLEN); if (rs->anchor == NULL) a[0] = 0; else |