summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 06:53:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 06:53:25 +0000
commitc7afa0cad957bfc4fd8f44a72bb99028bc99a523 (patch)
treeaa11c6258cf11381ad0f99ff41ad14a00796e1b8 /sys/net
parentb454ec3c7074138afddea405ca1b60f42efe01f7 (diff)
be paranoid in case the action array changes size (again, grr)
ok dlg
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_pfsync.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 96f46bd377f..0d39b3e6891 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.130 2009/11/03 10:59:04 claudio Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.131 2009/11/12 06:53:24 deraadt Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -698,7 +698,8 @@ pfsync_input(struct mbuf *m, ...)
m_copydata(m, offset, sizeof(subh), (caddr_t)&subh);
offset += sizeof(subh);
- if (subh.action >= PFSYNC_ACT_MAX) {
+ if (subh.action >= PFSYNC_ACT_MAX ||
+ subh.action >= nitems(pfsync_acts)) {
pfsyncstats.pfsyncs_badact++;
goto done;
}