summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-06-05 23:54:44 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-06-06 02:48:43 -0400
commit075241c773931d8ed9f2cc7d60a28ce95c48d497 (patch)
tree180f1256d68f02b2e021acd86a0bc843d1e3f2ad
parent72d4fe745170d190fba9eb94db0939938438bc5b (diff)
downloadlighttpd1.4-075241c773931d8ed9f2cc7d60a28ce95c48d497.tar.gz
lighttpd1.4-075241c773931d8ed9f2cc7d60a28ce95c48d497.zip
[mod_webdav] fix startup crash w/ multiple conds (fixes #2958)
(thx flynn) x-ref: "lighttpd 1.4.54 segfaults on start in mod_webdav" https://redmine.lighttpd.net/issues/2958
-rw-r--r--src/mod_webdav.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index 121e4033..39905298 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -1275,8 +1275,8 @@ SERVER_FUNC(mod_webdav_worker_init)
* across a fork() system call into the child process.
*/
plugin_data * const p = (plugin_data *)p_d;
- plugin_config *s = p->config_storage[0];
- for (int n_context = p->nconfig+1; --n_context; ++s) {
+ for (int i = 0; i < p->nconfig; ++i) {
+ plugin_config *s = p->config_storage[i];
if (!buffer_is_empty(s->sqlite_db_name)
&& mod_webdav_sqlite3_prep(s->sql, s->sqlite_db_name, srv->errh)
== HANDLER_ERROR)