Date: Sun, 11 Aug 2002 04:08:08 +0900 (JST) From: FUJITA Kazutoshi <fujita@soum.co.jp> To: freebsd-net@FreeBSD.ORG Cc: freebsd-hackers@FreeBSD.ORG Subject: m_freem() in tcp_respond() Message-ID: <20020811.040808.74720123.fujita@soum.co.jp>
next in thread | raw e-mail | index | archive | help
Hi, there.
In tcp_respond() from /sys/netinet/tcp_subr.c,
m_freem(m->m_next) is called without any checks.
I think it's better to check m->m_next is not NULL, at least.
--- /sys/netinet/tcp_subr.c.ORG Thu Jul 18 19:47:04 2002
+++ /sys/netinet/tcp_subr.c Sun Aug 11 04:00:09 2002
@@ -393,7 +393,8 @@
bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr));
flags = TH_ACK;
} else {
- m_freem(m->m_next);
+ if (m->m_next)
+ m_freem(m->m_next);
m->m_next = 0;
m->m_data = (caddr_t)ipgen;
/* m_len is set later */
Regards,
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020811.040808.74720123.fujita>
