diff options
author | glebius <glebius@FreeBSD.org> | 2015-05-18 15:05:12 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2015-05-18 15:05:12 +0000 |
commit | af369a5484f0ba2dd39bbe4b1e3566e14f23bb4e (patch) | |
tree | 77bffe738fb2b09976f07d846191a936b8ca3a12 | |
parent | 175ecf41754b9248d5fd06e2689ae69b3c280430 (diff) | |
download | FreeBSD-src-af369a5484f0ba2dd39bbe4b1e3566e14f23bb4e.zip FreeBSD-src-af369a5484f0ba2dd39bbe4b1e3566e14f23bb4e.tar.gz |
Don't dereference NULL is pf_get_mtag() fails.
PR: 200222
Submitted by: Franco Fichtner <franco opnsense.org>
-rw-r--r-- | sys/netpfil/pf/pf.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 6d24634..da74ecf 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 */ |