aboutsummaryrefslogtreecommitdiff
path: root/sys/netpfil
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2015-05-18 15:05:12 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2015-05-18 15:05:12 +0000
commitb7f69c506d057493bdee72f02b56df12b24c0bc6 (patch)
tree77bffe738fb2b09976f07d846191a936b8ca3a12 /sys/netpfil
parentd485dbc7d85eb23bde46d9d9d17cd3a2f863c5d4 (diff)
downloadsrc-b7f69c506d057493bdee72f02b56df12b24c0bc6.tar.gz
src-b7f69c506d057493bdee72f02b56df12b24c0bc6.zip
Don't dereference NULL is pf_get_mtag() fails.
PR: 200222 Submitted by: Franco Fichtner <franco opnsense.org>
Notes
Notes: svn path=/head/; revision=283061
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/pf/pf.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 6d24634e3214..da74ecf5fc5f 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -5903,13 +5903,14 @@ done:
((pd.pf_mtag = pf_get_mtag(m)) == NULL)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
+ } else {
+ if (pqid || (pd.tos & IPTOS_LOWDELAY))
+ pd.pf_mtag->qid = r->pqid;
+ else
+ pd.pf_mtag->qid = r->qid;
+ /* Add hints for ecn. */
+ pd.pf_mtag->hdr = h;
}
- if (pqid || (pd.tos & IPTOS_LOWDELAY))
- pd.pf_mtag->qid = r->pqid;
- else
- pd.pf_mtag->qid = r->qid;
- /* add hints for ecn */
- pd.pf_mtag->hdr = h;
}
#endif /* ALTQ */
@@ -6332,13 +6333,14 @@ done:
((pd.pf_mtag = pf_get_mtag(m)) == NULL)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
+ } else {
+ if (pd.tos & IPTOS_LOWDELAY)
+ pd.pf_mtag->qid = r->pqid;
+ else
+ pd.pf_mtag->qid = r->qid;
+ /* Add hints for ecn. */
+ pd.pf_mtag->hdr = h;
}
- if (pd.tos & IPTOS_LOWDELAY)
- pd.pf_mtag->qid = r->pqid;
- else
- pd.pf_mtag->qid = r->qid;
- /* add hints for ecn */
- pd.pf_mtag->hdr = h;
}
#endif /* ALTQ */