From ddb5372e6931a37da4f98685a44109fc10e6cfcb Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 15 Apr 2006 02:30:39 +0000 Subject: [PATCH] Coverity CID 1149: Add KASSERT before deref. --- sys/netinet/tcp_subr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 010620c56cfd..c6110573db86 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.197 2006/04/15 02:29:12 christos Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.198 2006/04/15 02:30:39 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.197 2006/04/15 02:29:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.198 2006/04/15 02:30:39 christos Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -1929,7 +1929,10 @@ tcp_mss_from_peer(struct tcpcb *tp, int offer) bufsize = rt->rt_rmx.rmx_sendpipe; else #endif + { + KASSERT(so != NULL); bufsize = so->so_snd.sb_hiwat; + } if (bufsize < mss) mss = bufsize; else {