summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchl <chl@openbsd.org>2010-06-29 19:28:13 +0000
committerchl <chl@openbsd.org>2010-06-29 19:28:13 +0000
commit1cf634310f4be6a7ccdbc5ff26daa2dc0b3296f0 (patch)
treea95c5c2225c1997ad6a4c1ad0f5ce0a1ff06c505
parentMore workarounds adapted from FreeBSD to make the 82577/82578 happy, (diff)
downloadwireguard-openbsd-1cf634310f4be6a7ccdbc5ff26daa2dc0b3296f0.tar.xz
wireguard-openbsd-1cf634310f4be6a7ccdbc5ff26daa2dc0b3296f0.zip
Fix use after free. Found by regress tests.
ok henning@ krw@
-rw-r--r--sbin/pfctl/pfctl_parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 0d59d25a339..5f7e0339d14 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.265 2010/05/16 12:23:30 zinovik Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.266 2010/06/29 19:28:13 chl Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1448,9 +1448,9 @@ host(const char *s)
err(1, "host: strdup");
mask = strtol(p+1, &q, 0);
if (!q || *q || mask > 128 || q == (p+1)) {
+ fprintf(stderr, "invalid netmask '%s'\n", p);
free(r);
free(ps);
- fprintf(stderr, "invalid netmask '%s'\n", p);
return (NULL);
}
p[0] = '\0';