httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo ...@perlig.de>
Subject Re: cvs commit: httpd-2.0/support check_forensic
Date Fri, 02 Jan 2004 23:33:18 GMT
* ben@apache.org wrote:

>   /* e is the first _invalid_ location in q
>      N.B. returns the terminating NUL.
>    */
>   static char *log_escape(char *q, const char *e, const char *p)
>   {
>       for ( ; *p ; ++p) {
>           assert(q < e);
>           if (*p < ' ' || *p >= 0x7f || *p == '|' || *p == ':' || *p == '%')
>           {
>               assert(q+2 < e);
>               *q++ = '%';
>               sprintf(q, "%02x", *(unsigned char *)p);
>               q += 2;
>           }
>           else
>               *q++ = *p;
>       }
>       assert(q < e);
>       *q = '\0';
>   
>       return q;
>   }

This function is not EBCDIC safe. I'd suggest to use one of the escaping
functions in server/util.c.
Additionally please use ap_assert, which logs before dumping. (applies to
other occurences as well).

nd

Mime
View raw message