Skip to content

Commit 9d15bfd

Browse files
committed
synchronized with lua-nginx-module #e94f2e5.
bugfix: fixed segfault in NGINX core >= 1.15.0 when init_worker_by_lua* is used. Thanks Datong Sun for the upstream patch.
1 parent d12acf4 commit 9d15bfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/subsys/ngx_subsys_lua_initworkerby.c.tt2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ngx_[% subsys %]_lua_init_worker(ngx_cycle_t *cycle)
4747
[% END %]
4848

4949
[% IF http_subsys %]
50+
ngx_conf_file_t cf_file;
5051
ngx_http_core_loc_conf_t *clcf, *top_clcf;
5152
ngx_http_lua_loc_conf_t *top_llcf;
5253

@@ -208,6 +209,10 @@ ngx_[% subsys %]_lua_init_worker(ngx_cycle_t *cycle)
208209
conf.log = cycle->log;
209210

210211
[% IF http_subsys %]
212+
ngx_memzero(&cf_file, sizeof(cf_file));
213+
cf_file.file.name = cycle->conf_file;
214+
conf.conf_file = &cf_file;
215+
211216
http_ctx.loc_conf = ngx_pcalloc(conf.pool,
212217
sizeof(void *) * ngx_http_max_module);
213218
if (http_ctx.loc_conf == NULL) {

0 commit comments

Comments
 (0)