httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: cvs commit: apache-1.3/src/modules/standard mod_log_referer.c
Date Thu, 21 May 1998 00:50:57 GMT
On Wed, 20 May 1998, Brian Behlendorf wrote:

> 
> 
> On Wed, 20 May 1998, Dean Gaudet wrote:
> > On 20 May 1998 brian@hyperreal.org wrote:
> > 
> > >   @@ -175,7 +176,7 @@
> > >        referer = ap_table_get(orig->headers_in, "Referer");
> > >        if (referer != NULL) {
> > >    
> > >   -
> > >   +        ap_str_tolower(referer);
> > >            /* The following is an upsetting mess of pointers, I'm sorry
> > >               Anyone with the motiviation and/or the time should feel free
> > >               to make this cleaner... */
> > 
> > -1.  This patch is broken.  You cannot downcase the value you get from
> > table_get()... the values in all tables are constants.  You should replace
> > the to str_tolower()s with a single strcasecmp() or whatever.
> 
> The comparison is a strstr though; so far as I know there isn't a
> strcasestr available.  I suppose I can use regex... or just create a 
> new buffer.
> 
> Odd that the patch seemed to work fine, no compile errors and testing
> showed it did the job...

Except that if you check the referer after the fact in some other module,
etc. you will find that it has been modified.  That is bad.


Mime
View raw message