--- embedaddon/lighttpd/src/mod_dirlisting.c 2013/10/14 10:32:47 1.1.1.1 +++ embedaddon/lighttpd/src/mod_dirlisting.c 2014/06/15 20:20:06 1.1.1.2 @@ -278,7 +278,7 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) { if (!p) return HANDLER_ERROR; - p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); + p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *)); for (i = 0; i < srv->config_context->used; i++) { plugin_config *s; @@ -672,7 +672,7 @@ static int http_list_directory(server *srv, connection #endif path = malloc(dir->used + name_max); - assert(path); + force_assert(path); strcpy(path, dir->ptr); path_file = path + i; @@ -685,11 +685,11 @@ static int http_list_directory(server *srv, connection } dirs.ent = (dirls_entry_t**) malloc(sizeof(dirls_entry_t*) * DIRLIST_BLOB_SIZE); - assert(dirs.ent); + force_assert(dirs.ent); dirs.size = DIRLIST_BLOB_SIZE; dirs.used = 0; files.ent = (dirls_entry_t**) malloc(sizeof(dirls_entry_t*) * DIRLIST_BLOB_SIZE); - assert(files.ent); + force_assert(files.ent); files.size = DIRLIST_BLOB_SIZE; files.used = 0; @@ -730,7 +730,11 @@ static int http_list_directory(server *srv, connection log_error_write(srv, __FILE__, __LINE__, "sd", "execution error while matching:", n); - return -1; + /* aborting would require a lot of manual cleanup here. + * skip instead (to not leak names that break pcre matching) + */ + exclude_match = 1; + break; } } else { @@ -762,7 +766,7 @@ static int http_list_directory(server *srv, connection if (list->used == list->size) { list->size += DIRLIST_BLOB_SIZE; list->ent = (dirls_entry_t**) realloc(list->ent, sizeof(dirls_entry_t*) * list->size); - assert(list->ent); + force_assert(list->ent); } tmp = (dirls_entry_t*) malloc(sizeof(dirls_entry_t) + 1 + i);