You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2003/02/19 05:01:19 UTC

Re: [patch 1.3] avoid segfaults in ap_unescape_url with empty strings

Stas Bekman wrote:
> This ia an apache-1.3 issue

please disregard this one for now. I couldn't reproduce the problem and 
based the possible solution on the posted backtrace, but it looks like 
it's not what's happenning. I'll follow up after I dig more into this.

> Richard Clarke <ri...@likewhoa.com> has reported the following segfault on 
> the modperl list. The following patch tries to prevent the segfault:
> 
> Program received signal SIGBUS, Bus error.
> 0x80b445b in ap_unescape_url (url=0x8162e89 "") at util.c:1609
> 1609        url[x] = '\0';
> (gdb) bt
> #0  0x80b445b in ap_unescape_url (url=0x8162e89 "") at util.c:1609
> #1  0x8085c20 in XS_Apache_unescape_url (cv=0x8227b0c) at Apache.c:931
> [...]
> 
> Index: src/main/util.c
> ===================================================================
> RCS file: /home/cvspublic/apache-1.3/src/main/util.c,v
> retrieving revision 1.206
> diff -u -r1.206 util.c
> --- src/main/util.c     18 Jun 2002 00:59:58 -0000      1.206
> +++ src/main/util.c     19 Feb 2003 05:12:04 -0000
> @@ -1588,6 +1588,10 @@
>  {
>      register int x, y, badesc, badpath;
> 
> +    /* if the url is empty just return */
> +    if (url && url[0] == '\0')
> +        return OK;
> +
>      badesc = 0;
>      badpath = 0;
>      for (x = 0, y = 0; url[y]; ++x, ++y) {
> 
> 
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com