From da91486679507cd3dc4a139318e05ce04e151145 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Tue, 29 Jan 2013 19:40:28 +0800 Subject: [PATCH] Modules/IPStack - Fixed NULL dereference in routing --- KernelLand/Modules/IPStack/routing.c | 5 +++-- KernelLand/Modules/IPStack/tcp.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/KernelLand/Modules/IPStack/routing.c b/KernelLand/Modules/IPStack/routing.c index d9efa99f..e86f333b 100644 --- a/KernelLand/Modules/IPStack/routing.c +++ b/KernelLand/Modules/IPStack/routing.c @@ -115,12 +115,13 @@ tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name) { LOG("Why does this route not have a node? trying to find an iface for the next hop"); - rt = _Route_FindInterfaceRoute(type, rt->NextHop); - if(!rt) { + void *nextrt = _Route_FindInterfaceRoute(type, rt->NextHop); + if(!nextrt) { Log_Notice("Cannot find route to next hop '%s'", IPStack_PrintAddress(type, rt->NextHop)); return NULL; } + rt = nextrt; } if( !rt->Interface ) { Log_Notice("Routes", "No interface for route %p, what the?", rt); diff --git a/KernelLand/Modules/IPStack/tcp.c b/KernelLand/Modules/IPStack/tcp.c index 8b4f99db..f1eee656 100644 --- a/KernelLand/Modules/IPStack/tcp.c +++ b/KernelLand/Modules/IPStack/tcp.c @@ -1354,7 +1354,8 @@ void TCP_Client_Close(tVFS_Node *Node) while( conn->State == TCP_ST_FIN_WAIT1 ) Threads_Yield(); break; default: - Log_Warning("TCP", "Unhandled connection state in TCP_Client_Close"); + Log_Warning("TCP", "Unhandled connection state %i in TCP_Client_Close", + conn->State); break; } -- 2.20.1