Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet tcp: restore NULL check for inp in tcp_ctloutput



details:   https://anonhg.NetBSD.org/src/rev/47678ba1991f
branches:  trunk
changeset: 372197:47678ba1991f
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Sun Oct 30 08:45:46 2022 +0000

description:
tcp: restore NULL check for inp in tcp_ctloutput

diffstat:

 sys/netinet/tcp_usrreq.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r b04d14dd7fe4 -r 47678ba1991f sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Sun Oct 30 01:49:30 2022 +0000
+++ b/sys/netinet/tcp_usrreq.c  Sun Oct 30 08:45:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_usrreq.c,v 1.235 2022/10/29 15:35:16 ozaki-r Exp $ */
+/*     $NetBSD: tcp_usrreq.c,v 1.236 2022/10/30 08:45:46 ozaki-r Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.235 2022/10/29 15:35:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.236 2022/10/30 08:45:46 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -272,6 +272,10 @@
 
        s = splsoftnet();
        inp = sotoinpcb(so);
+       if (inp == NULL) {
+               splx(s);
+               return ECONNRESET;
+       }
        if (level != IPPROTO_TCP) {
                switch (family) {
                case PF_INET:



Home | Main Index | Thread Index | Old Index