Browse Source

fix segfaults in many plugins if they failed configuration

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2988 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.36
Stefan Bühler 7 years ago
parent
commit
33cebeb0f7
  1. 1
      NEWS
  2. 2
      src/mod_access.c
  3. 2
      src/mod_accesslog.c
  4. 2
      src/mod_alias.c
  5. 2
      src/mod_auth.c
  6. 2
      src/mod_cgi.c
  7. 2
      src/mod_cml.c
  8. 2
      src/mod_compress.c
  9. 2
      src/mod_evasive.c
  10. 2
      src/mod_evhost.c
  11. 3
      src/mod_expire.c
  12. 2
      src/mod_extforward.c
  13. 2
      src/mod_fastcgi.c
  14. 2
      src/mod_flv_streaming.c
  15. 2
      src/mod_indexfile.c
  16. 2
      src/mod_magnet.c
  17. 7
      src/mod_proxy.c
  18. 2
      src/mod_redirect.c
  19. 3
      src/mod_rewrite.c
  20. 2
      src/mod_rrdtool.c
  21. 2
      src/mod_scgi.c
  22. 2
      src/mod_secure_download.c
  23. 2
      src/mod_setenv.c
  24. 2
      src/mod_skeleton.c
  25. 2
      src/mod_ssi.c
  26. 2
      src/mod_staticfile.c
  27. 2
      src/mod_trigger_b4_dl.c
  28. 2
      src/mod_uploadprogress.c
  29. 2
      src/mod_userdir.c
  30. 2
      src/mod_usertrack.c
  31. 2
      src/mod_webdav.c

1
NEWS

@ -18,6 +18,7 @@ NEWS
* major refactoring of internal buffer/chunk handling
* [mod_auth] use crypt_r instead of crypt if available
* fix error message for T_CONFIG_ARRAY config values if an entry value is not a string
* fix segfaults in many plugins if they failed configuration
- 1.4.35 - 2014-03-12
* [network/ssl] fix build error if TLSEXT is disabled

2
src/mod_access.c

@ -40,6 +40,8 @@ FREE_FUNC(mod_access_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->access_deny);
free(s);

2
src/mod_accesslog.c

@ -414,7 +414,7 @@ FREE_FUNC(mod_accesslog_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
if (!buffer_string_is_empty(s->access_logbuffer)) {
if (s->log_access_fd != -1) {

2
src/mod_alias.c

@ -45,7 +45,7 @@ FREE_FUNC(mod_alias_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if(!s) continue;
if (NULL == s) continue;
array_free(s->alias);

2
src/mod_auth.c

@ -60,7 +60,7 @@ FREE_FUNC(mod_auth_free) {
for (i = 0; i < srv->config_context->used; i++) {
mod_auth_plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->auth_require);
buffer_free(s->auth_plain_groupfile);

2
src/mod_cgi.c

@ -127,6 +127,8 @@ FREE_FUNC(mod_cgi_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->cgi);
free(s);

2
src/mod_cml.c

@ -43,6 +43,8 @@ FREE_FUNC(mod_cml_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
buffer_free(s->ext);
buffer_free(s->mc_namespace);

2
src/mod_compress.c

@ -90,7 +90,7 @@ FREE_FUNC(mod_compress_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->compress);
buffer_free(s->compress_cache_dir);

2
src/mod_evasive.c

@ -58,6 +58,8 @@ FREE_FUNC(mod_evasive_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
free(s);
}
free(p->config_storage);

2
src/mod_evhost.c

@ -46,7 +46,7 @@ FREE_FUNC(mod_evhost_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
if(s->path_pieces) {
size_t j;

3
src/mod_expire.c

@ -62,7 +62,8 @@ FREE_FUNC(mod_expire_free) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->expire_url);
free(s);

2
src/mod_extforward.c

@ -135,7 +135,7 @@ FREE_FUNC(mod_extforward_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->forwarder);
array_free(s->headers);

2
src/mod_fastcgi.c

@ -693,7 +693,7 @@ FREE_FUNC(mod_fastcgi_free) {
plugin_config *s = p->config_storage[i];
fcgi_exts *exts;
if (!s) continue;
if (NULL == s) continue;
exts = s->exts;

2
src/mod_flv_streaming.c

@ -54,7 +54,7 @@ FREE_FUNC(mod_flv_streaming_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->extensions);

2
src/mod_indexfile.c

@ -51,7 +51,7 @@ FREE_FUNC(mod_indexfile_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->indexfiles);

2
src/mod_magnet.c

@ -71,7 +71,7 @@ FREE_FUNC(mod_magnet_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->url_raw);
array_free(s->physical_path);

7
src/mod_proxy.c

@ -167,12 +167,11 @@ FREE_FUNC(mod_proxy_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (s) {
if (NULL == s) continue;
array_free(s->extensions);
array_free(s->extensions);
free(s);
}
free(s);
}
free(p->config_storage);
}

2
src/mod_redirect.c

@ -47,6 +47,8 @@ FREE_FUNC(mod_redirect_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
pcre_keyvalue_buffer_free(s->redirect);
free(s);

3
src/mod_rewrite.c

@ -146,6 +146,9 @@ FREE_FUNC(mod_rewrite_free) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
rewrite_rule_buffer_free(s->rewrite);
rewrite_rule_buffer_free(s->rewrite_NF);

2
src/mod_rrdtool.c

@ -65,6 +65,8 @@ FREE_FUNC(mod_rrd_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
buffer_free(s->path_rrdtool_bin);
buffer_free(s->path_rrd);

2
src/mod_scgi.c

@ -554,7 +554,7 @@ FREE_FUNC(mod_scgi_free) {
plugin_config *s = p->config_storage[i];
scgi_exts *exts;
if (!s) continue;
if (NULL == s) continue;
exts = s->exts;

2
src/mod_secure_download.c

@ -65,6 +65,8 @@ FREE_FUNC(mod_secdownload_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
buffer_free(s->secret);
buffer_free(s->doc_root);
buffer_free(s->uri_prefix);

2
src/mod_setenv.c

@ -67,6 +67,8 @@ FREE_FUNC(mod_setenv_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->request_header);
array_free(s->response_header);
array_free(s->environment);

2
src/mod_skeleton.c

@ -79,7 +79,7 @@ FREE_FUNC(mod_skeleton_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
array_free(s->match);

2
src/mod_ssi.c

@ -69,6 +69,8 @@ FREE_FUNC(mod_ssi_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->ssi_extension);
buffer_free(s->content_type);

2
src/mod_staticfile.c

@ -63,6 +63,8 @@ FREE_FUNC(mod_staticfile_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->exclude_ext);
free(s);

2
src/mod_trigger_b4_dl.c

@ -89,7 +89,7 @@ FREE_FUNC(mod_trigger_b4_dl_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
buffer_free(s->db_filename);
buffer_free(s->download_url);

2
src/mod_uploadprogress.c

@ -174,6 +174,8 @@ FREE_FUNC(mod_uploadprogress_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
buffer_free(s->progress_url);
free(s);

2
src/mod_userdir.c

@ -60,6 +60,8 @@ FREE_FUNC(mod_userdir_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
array_free(s->include_user);
array_free(s->exclude_user);
buffer_free(s->path);

2
src/mod_usertrack.c

@ -48,6 +48,8 @@ FREE_FUNC(mod_usertrack_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (NULL == s) continue;
buffer_free(s->cookie_name);
buffer_free(s->cookie_domain);

2
src/mod_webdav.c

@ -120,7 +120,7 @@ FREE_FUNC(mod_webdav_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
if (NULL == s) continue;
buffer_free(s->sqlite_db_name);
#ifdef USE_PROPPATCH

Loading…
Cancel
Save