summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-11-29 13:03:25 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-11-29 13:03:25 +0000
commit735c4ff65fab3f8fbd7b8bf1cd0d339857078d01 (patch)
tree9f86666ed1ac776e81180ce19259fbfa1ae1b9a1 /sys
parent36b5e219fd88986592e92468b60f222f9c68769a (diff)
Get the address pool in DIOCCHANGEADDR for all operations, prevents
PF_CHANGE_REMOVE from dereferencing a NULL pointer. Noticed by dhartmei@ ok dhartmei@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_ioctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 94b467816b3..104ededd233 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.19 2002/11/26 03:44:53 kjc Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.20 2002/11/29 13:03:24 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2251,12 +2251,12 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
break;
}
+ pool = pf_get_pool(0, pca->r_id, pca->r_num, 1, 0);
+ if (pool == NULL) {
+ error = EBUSY;
+ break;
+ }
if (pca->action != PF_CHANGE_REMOVE) {
- pool = pf_get_pool(0, pca->r_id, pca->r_num, 1, 0);
- if (pool == NULL) {
- error = EBUSY;
- break;
- }
newpa = pool_get(&pf_pooladdr_pl, PR_NOWAIT);
if (newpa == NULL) {
error = ENOMEM;