summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2001-09-08 02:10:34 +0000
committerNiels Provos <provos@cvs.openbsd.org>2001-09-08 02:10:34 +0000
commit59ce13b952683f28ffc65b72f9aebd5695eeed9a (patch)
tree697dd17bacacc56764003558315f50ff960322be /sys/net
parent63bf6a6ce49fd2e45c947f6b6105a958365f6858 (diff)
initialize variable and more careful bounts checking; okay frantzen@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf_norm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c
index 49b41cf267b..8663998cc76 100644
--- a/sys/net/pf_norm.c
+++ b/sys/net/pf_norm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_norm.c,v 1.9 2001/09/06 20:53:44 dhartmei Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.10 2001/09/08 02:10:33 provos Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -243,7 +243,8 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment *frag,
struct pf_frent *frent, int mff)
{
struct mbuf *m = *m0, *m2;
- struct pf_frent *frep, *frea, *next;
+ struct pf_frent *frea, *next;
+ struct pf_frent *frep = NULL;
struct ip *ip = frent->fr_ip;
int hlen = ip->ip_hl << 2;
u_int16_t off = ip->ip_off;
@@ -300,7 +301,7 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment *frag,
u_int16_t precut;
precut = frep->fr_ip->ip_off + frep->fr_ip->ip_len - off;
- if (precut > ip->ip_len)
+ if (precut >= ip->ip_len)
goto drop_fragment;
if (precut) {
m_adj(frent->fr_m, precut);