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

global context (fixes #800)



git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1735 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.14
Jan Kneschke 16 years ago
parent dfa9f48b0f
commit aa37da4745

@ -32,7 +32,9 @@ NEWS
* fixed handling of %% in accesslog.format
* fixed conditional dir-listing.exclude (#930)
* reduced default PATH_MAX to 255 (#826)
* ECONNABORTED is not known on cygwin (fixes #863)
* ECONNABORTED is not known on cygwin (#863)
* fixed crash on url.redirect and url.rewrite if %0 is used in a global context
(#800)
- 1.4.13 - 2006-10-09

@ -140,6 +140,7 @@ static int mod_redirect_patch_connection(server *srv, connection *con, plugin_da
plugin_config *s = p->config_storage[0];
p->conf.redirect = s->redirect;
p->conf.context = NULL;
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
@ -229,6 +230,11 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
if (num < (size_t)n) {
buffer_append_string(p->location, list[num]);
}
} else if (p->conf.context == NULL) {
/* we have no context, we are global */
log_error_write(srv, __FILE__, __LINE__, "sb",
"used a rewrite containing a %[0-9]+ in the global scope, ignored:",
kv->value);
} else {
config_append_cond_match_buffer(con, p->conf.context, p->location, num);
}

@ -270,7 +270,9 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
p->conf.rewrite = s->rewrite;
p->conf.context = NULL;
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
@ -398,6 +400,12 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
if (num < (size_t)n) {
buffer_append_string(con->request.uri, list[num]);
}
} else if (p->conf.context == NULL) {
/* we have no context, we are global */
log_error_write(srv, __FILE__, __LINE__, "sb",
"used a redirect containing a %[0-9]+ in the global scope, ignored:",
rule->value);
} else {
config_append_cond_match_buffer(con, p->conf.context, con->request.uri, num);
}

Loading…
Cancel
Save