HTHost.c (HTNet.c) 4.1b1 persistence, *NULL

file:///D|/LeapFrog/w3c-libwww-4.1b1/Library/src/or
iginal/diffmail.txt

	Z

-- 
Bill Rizzi	rizzi@softserv.com			
Software Services
    Z		http://www.softserv.com/~rizzi		
Santa Barbara, CA
	The HThost.c HTHost_setChannel() function can dereference a
NULL pointer and cause a segmentation fault.  This happens when called
with a non-NULL host pointer and a NULL channel pointer.

	The HTHost.c diff below fixes that problem.  The HTNet.c diff
merely gives a better idea of the actual persistence status when
tracing.

	libwww 41.b1 on Solaris 2.x : -D_REENTRANT 

	running MiniServ (webd), testing with www (also lynx, Netscape)

HTNet.c
782,783c782,783
< 	BOOL success;
< 
---
> 	if (CORE_TRACE) HTTrace("Net......... Persistent connection set %s\n",
> 				persistent ? "ON" : "OFF");
785c785
< 	    success = HTHost_setChannel(net->host, net->channel);
---
> 	    HTHost_setChannel(net->host, net->channel);
787,793c787
< 	    success = HTHost_clearChannel(net->host);
< 
< 	if (CORE_TRACE) HTTrace("Net......... Persistent connection set %s %s\n",
< 				persistent ? "ON" : "OFF",
< 				success ? "succeeded" : "failed");
< 
< 	return success;
---
> 	    HTHost_clearChannel(net->host);

HThost.c
248a249
> #if 0
249a251,253
> #else
>     if (!host) return NO;
> #endif
252a257
> #if 0
253a259,261
> #else
>     } else if (channel) {
> #endif

Received on Wednesday, 14 August 1996 21:09:54 UTC