diff options
author | 2016-10-19 08:34:53 +0000 | |
---|---|---|
committer | 2016-10-19 08:34:53 +0000 | |
commit | 15f73203e2b0a646d176869e20fd189e0a95ba2f (patch) | |
tree | c69d1635d655416a5a883215f209cf8e53145c61 | |
parent | Change process_{domem,auxv_offset}() to take a process instead of a proc. (diff) | |
download | wireguard-openbsd-15f73203e2b0a646d176869e20fd189e0a95ba2f.tar.xz wireguard-openbsd-15f73203e2b0a646d176869e20fd189e0a95ba2f.zip |
Lets just be safe and check M_PREPEND return values for functions that
madj() and injects back the layer 2/3 contents.
ok lteo@
-rw-r--r-- | sys/net/switchofp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c index cb5b161d705..31cc6d96acd 100644 --- a/sys/net/switchofp.c +++ b/sys/net/switchofp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchofp.c,v 1.13 2016/10/12 09:50:55 rzalamena Exp $ */ +/* $OpenBSD: switchofp.c,v 1.14 2016/10/19 08:34:53 rzalamena Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -3556,6 +3556,9 @@ swofp_apply_set_field_ipv6(struct mbuf *m, int off, in6_proto_cksum_out(m, NULL); M_PREPEND(m, off, M_DONTWAIT); + if (m == NULL) + return (NULL); + m_copyback(m, 0, off, eh_bk, M_DONTWAIT); return (m); @@ -3631,6 +3634,9 @@ swofp_apply_set_field_ipv4(struct mbuf *m, int off, ip->ip_sum = in_cksum(m, hlen); M_PREPEND(m, off, M_DONTWAIT); + if (m == NULL) + return (NULL); + m_copyback(m, 0, off, eh_bk, M_DONTWAIT); return (m); |