summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2010-06-29 19:28:14 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2010-06-29 19:28:14 +0000
commita4dab98ec00d46ab4c67798c88e88a238fe670ab (patch)
treecd0c22eac701ec47b68a280c98e0925a0ca0c1e6
parenta414260538ba5ae94fcb51aa97991f7e7b115e49 (diff)
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';