Changeset 1735

Show
Ignore:
Timestamp:
04/10/2007 07:52:58 AM (18 months ago)
Author:
jan
Message:

- fixed crash on url.redirect and url.rewrite if %0 is used in a

global context (fixes #800)

Location:
branches/lighttpd-1.4.x
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r1734 r1735  
    3333  * fixed conditional dir-listing.exclude (#930) 
    3434  * reduced default PATH_MAX to 255 (#826) 
    35   * ECONNABORTED is not known on cygwin (fixes #863) 
     35  * ECONNABORTED is not known on cygwin (#863) 
     36  * fixed crash on url.redirect and url.rewrite if %0 is used in a global context 
     37    (#800) 
    3638 
    3739 
  • branches/lighttpd-1.4.x/src/mod_redirect.c

    r1371 r1735  
    141141 
    142142        p->conf.redirect = s->redirect; 
     143        p->conf.context = NULL; 
    143144 
    144145        /* skip the first, the global context */ 
     
    230231                                                        buffer_append_string(p->location, list[num]); 
    231232                                                } 
     233                                        } else if (p->conf.context == NULL) { 
     234                                                /* we have no context, we are global */ 
     235                                                log_error_write(srv, __FILE__, __LINE__, "sb", 
     236                                                                "used a rewrite containing a %[0-9]+ in the global scope, ignored:", 
     237                                                                kv->value); 
    232238                                        } else { 
    233239                                                config_append_cond_match_buffer(con, p->conf.context, p->location, num); 
  • branches/lighttpd-1.4.x/src/mod_rewrite.c

    r1371 r1735  
    271271        size_t i, j; 
    272272        plugin_config *s = p->config_storage[0]; 
     273 
    273274        p->conf.rewrite = s->rewrite; 
     275        p->conf.context = NULL; 
    274276 
    275277        /* skip the first, the global context */ 
     
    399401                                                        buffer_append_string(con->request.uri, list[num]); 
    400402                                                } 
     403                                        } else if (p->conf.context == NULL) { 
     404                                                /* we have no context, we are global */ 
     405                                                log_error_write(srv, __FILE__, __LINE__, "sb", 
     406                                                                "used a redirect containing a %[0-9]+ in the global scope, ignored:", 
     407                                                                rule->value); 
     408 
    401409                                        } else { 
    402410                                                config_append_cond_match_buffer(con, p->conf.context, con->request.uri, num);