Project

General

Profile

Bug #2993

segmentation fault with 8 $HTTP["url"] and mod_webdav

Added by khumarahn 7 months ago. Updated 7 months ago.

Status:
Duplicate
Priority:
Normal
Category:
mod_webdav
Target version:
ASK QUESTIONS IN Forums:

Description

Hi. I get a segfault with a simple configuration file (which is a simplified version of what I actually use):

var.basedir  = "/var/www/localhost" 
var.logdir   = "/var/log/lighttpd" 
var.statedir = "/var/lib/lighttpd" 

server.modules = (
    "mod_webdav" 
)

include "mime-types.conf" 

server.username      = "lighttpd" 
server.groupname     = "lighttpd" 

server.document-root = var.basedir + "/htdocs" 
server.pid-file      = "/var/run/lighttpd.pid" 

server.errorlog      = var.logdir  + "/error.log" 

$HTTP["url"] =~ "^/a/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/b/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/c/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/d/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/e/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/f/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/g/" {
        dir-listing.activate = "disable" 
}
$HTTP["url"] =~ "^/h/" {
        dir-listing.activate = "disable" 
}

# vim: set ft=conf foldmethod=marker et :
# lighttpd -D -f lighttpd.test.conf && echo "ok" 
Segmentation fault

The segfault does not happen if I remove at least one of $HTTP["url"] directives, or if I remove mod_webdav. I run gentoo on a 32 bit arm vps. Lighttpd version is 1.4.54.


Files

lighttpd.test.conf (977 Bytes) lighttpd.test.conf khumarahn, 2019-11-25 11:44

Related issues

Is duplicate of Bug #2958: lighttpd 1.4.54 segfaults on start in mod_webdavFixed2019-06-05Actions
#1

Updated by flynn 7 months ago

This should be already fixed for version 1.4.55, see #2958 for further information.

#2

Updated by khumarahn 7 months ago

Thanks a lot!!! 1.4.55 is not yet available.. Is it ok to use this patch on 1.4.54?

commit 075241c773931d8ed9f2cc7d60a28ce95c48d497
Author: Glenn Strauss <gstrauss@gluelogic.com>
Date:   Wed Jun 5 23:54:44 2019 -0400

    [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

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)

#3

Updated by khumarahn 7 months ago

Anyway, I applied the patch and lighttpd looks working. Thanks again. How do I close issues here....

#4

Updated by gstrauss 7 months ago

  • Category set to mod_webdav
  • Status changed from New to Duplicate
#5

Updated by gstrauss 7 months ago

  • Is duplicate of Bug #2958: lighttpd 1.4.54 segfaults on start in mod_webdav added

Also available in: Atom