summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-03-17 09:26:36 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-03-17 09:26:36 +0000
commita0902cea783baca87e97b8b6e9265532814bb774 (patch)
tree9bc6f2c320f9480ae8894eea795e1008ab0bbdc1 /sys
parent1a3a431bff0ebd6ac122a6cde26596d5e7ed7cc3 (diff)
Since we're not always called with M_WAIT, check return value from
MGETHDR and fail if it's NULL. ok miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c
index 9a3ac666564..9a7117553f5 100644
--- a/sys/kern/uipc_mbuf2.c
+++ b/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf2.c,v 1.27 2007/02/26 20:15:33 claudio Exp $ */
+/* $OpenBSD: uipc_mbuf2.c,v 1.28 2007/03/17 09:26:35 art Exp $ */
/* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
@@ -231,6 +231,8 @@ m_dup1(struct mbuf *m, int off, int len, int wait)
return (NULL);
if (off == 0 && (m->m_flags & M_PKTHDR) != 0) {
MGETHDR(n, wait, m->m_type);
+ if (n == NULL)
+ return (NULL);
M_DUP_PKTHDR(n, m);
l = MHLEN;
} else {