[Prev][Next][Index][Thread]

Re: Bug repport, 2.15 library, modeule HTFile.c



Hi

Most (if not all?) of such bugs are fixed in the 2.16 (pre 2) version.
HTFile.c is almost rewritten in this version. Generally the version
2.16 has an enhanced set of functionality compared to the 2.15
version.

-- cheers --

Henrik Frystyk


> In the module HTFile.c from the CERN WWW library, version 2.15, there are these  
> lines.
> 
>  /*	Directory access is allowed and possible
>  */
> 		logical = HTAnchor_address((HTAnchor*)anchor);
> 		tail = strrchr(logical, '/') +1;	/* last part or "" */
> 
> but when there is no '/' in the string, strrchr returns NILL, wich become  
> 0x0001.
> This made my browser stop on the URL 'file:'.
> 
> I've replaced the line:
>     'tail = strrchr(logical, '/') +1;	/* last part or "" */'
> by (this is a quick hack):
> 
> 	{ char *tempTail;
>           if (tempTail = strrchr(logical, '/'))	
> 		    tail=tempTail+1;
>            else
>             tail=tail+strlen(tail);
>         }
> 
> I've also seen that there are other similar uses of the 'strrchr' function.  
> This may cause some other bugs.