W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2003

Re: Possible bug inside HTProfile_delete() after FTP download?

From: Tim Serong <tim.serong@conceiva.com>
Date: Wed, 12 Mar 2003 16:12:22 +1100
Message-ID: <8501919721C3DE4C81BCA22846B08721BC0E@lazarus.conceiva.com>
To: "Steven Gray" <sgray004@hotmail.com>
Cc: <www-lib@w3.org>

On Thu, 17 Oct 2002, Steven Gray wrote:
> 
> Windows platform
> libwww version 5.4.0 built as DLLs
> NoCacheClient profile
> Using HTLoadToFile with an "ftp://user:pwd@foo.bar/file" URL.
> Note, an identically coded HTTP request "http://foo.bar/file"
> does not cause this bug to occur.
> 
> The above FTP URL causes a memory access violation to occur
> within HTChannel_deleteAll() when I attempt cleanup via
> HTProfile_delete()....

I had the exact same problem, and after much digging found a patch from
Peter Stamfest that solves it.  The patch, along with an explanation,
can be found at
http://lists.w3.org/Archives/Public/www-lib/2000JulSep/0241.html

> For me, the bandaid solution was to modify the implementation of 
> HTHost_getReadNet() with this ugly hack:
> 
> PUBLIC HTNet * HTHost_getReadNet(HTHost * host)
> {
> #ifdef WIN32 /* !!!yikes!!! */
>    if (IsBadReadPtr(host->pipeline, 1))
>       return NULL;
> #endif
>     return host ? (HTNet *) HTList_firstObject(host->pipeline) : NULL;
> }

Peter's patch fixes the problem at the source ie: when the channel is
first deleted, once the FTP operation is complete.  This is much neater
than using the Win32 IsBadReadPtr function later on in the game.

Regards,

Tim Serong
-- 
tim.serong@conceiva.com
http://www.conceiva.com
Received on Wednesday, 12 March 2003 00:12:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:43 GMT