From e1e331508a62bcd02e7a26960ca7ea51f97724c8 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Mon, 29 May 2006 12:43:01 +0000 Subject: [PATCH] Hidden bug in our tcp/ip stack, at shutdown api the so can be NULL if that happen, ReactOS will bsod the tcp/ip stack. Arty can u look if this changes is right if not revert it. This changes was tested in fireforx at http://www.mirc.com/get.html and try d/l mirc. This patch do not make firefox bsod, instead it genrate a long crash log at serial debug. svn path=/trunk/; revision=22106 --- reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c b/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c index e95192231d7..05997ff3a64 100644 --- a/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c +++ b/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c @@ -827,6 +827,19 @@ soshutdown(so, how) register struct socket *so; register int how; { + if (so == NULL) + { + register struct protosw *pr = NULL; + + how++; + if (how & FREAD) + sorflush(so); + if (how & FWRITE) + return ((*pr->pr_usrreq)(so, PRU_SHUTDOWN, + (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0)); + return (0); + } + register struct protosw *pr = so->so_proto; how++;