Browse Source

[mod_redirect,mod-rewrite] short-circuit if blank replacement (fixes #2085)

x-ref:
  "null redirects for mod_redirect"
  https://redmine.lighttpd.net/issues/2085
personal/stbuehler/mod-csrf-old
Glenn Strauss 6 years ago
parent
commit
186e7073fb
  1. 1
      NEWS
  2. 4
      src/mod_redirect.c
  3. 4
      src/mod_rewrite.c

1
NEWS

@ -76,6 +76,7 @@ NEWS
* [core] setrlimit max-fds <= rlim_max for non-root (fixes #2723)
* [mod_ssi] config ssi.conditional-requests
* [mod_ssi] config ssi.exec (fixes #2051)
* [mod_redirect,mod_rewrite] short-circuit if blank replacement (fixes #2085)
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)

4
src/mod_redirect.c

@ -209,6 +209,10 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
"execution error while matching: ", n);
return HANDLER_ERROR;
}
} else if (0 == pattern_len) {
/* short-circuit if blank replacement pattern
* (do not attempt to match against remaining redirect rules) */
return HANDLER_GO_ON;
} else {
const char **list;
size_t start;

4
src/mod_rewrite.c

@ -383,6 +383,10 @@ static handler_t process_rewrite_rules(server *srv, connection *con, plugin_data
"execution error while matching: ", n);
return HANDLER_ERROR;
}
} else if (0 == pattern_len) {
/* short-circuit if blank replacement pattern
* (do not attempt to match against remaining rewrite rules) */
return HANDLER_GO_ON;
} else {
const char **list;
size_t start;

Loading…
Cancel
Save