diff options
author | 2017-06-19 17:58:49 +0000 | |
---|---|---|
committer | 2017-06-19 17:58:49 +0000 | |
commit | 36c0109eae52b8c24faab57b6f949fb2dd622cb5 (patch) | |
tree | cc0859199dae91d7020bdd7213495b91146b5a01 /sys/netinet6 | |
parent | delete accidental blank line (diff) | |
download | wireguard-openbsd-36c0109eae52b8c24faab57b6f949fb2dd622cb5.tar.xz wireguard-openbsd-36c0109eae52b8c24faab57b6f949fb2dd622cb5.zip |
When dealing with mbuf pointers passed down as function parameters,
bugs could easily result in use-after-free or double free. Introduce
m_freemp() which automatically resets the pointer before freeing
it. So we have less dangling pointers in the kernel.
OK krw@ mpi@ claudio@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index b763c59e562..53dfe484017 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.195 2017/06/19 17:00:16 bluhm Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.196 2017/06/19 17:58:49 bluhm Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -579,7 +579,7 @@ ip6_deliver(struct mbuf **mp, int *offp, int nxt, int af) } return; bad: - m_freem(*mp); + m_freemp(mp); } int |