Skip to content

Commit e94f2e5

Browse files
dndxagentzh
authored andcommitted
bugfix: fixed segfault in NGINX core >= 1.15.0 when init_worker_by_lua* is used.
Signed-off-by: Yichun Zhang (agentzh) <[email protected]>
1 parent 576a10d commit e94f2e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ngx_http_lua_initworkerby.c

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ngx_http_lua_init_worker(ngx_cycle_t *cycle)
2525
void *cur, *prev;
2626
ngx_uint_t i;
2727
ngx_conf_t conf;
28+
ngx_conf_file_t cf_file;
2829
ngx_cycle_t *fake_cycle;
2930
ngx_module_t **modules;
3031
ngx_open_file_t *file, *ofile;
@@ -166,6 +167,10 @@ ngx_http_lua_init_worker(ngx_cycle_t *cycle)
166167
conf.pool = fake_cycle->pool;
167168
conf.log = cycle->log;
168169

170+
ngx_memzero(&cf_file, sizeof(cf_file));
171+
cf_file.file.name = cycle->conf_file;
172+
conf.conf_file = &cf_file;
173+
169174
http_ctx.loc_conf = ngx_pcalloc(conf.pool,
170175
sizeof(void *) * ngx_http_max_module);
171176
if (http_ctx.loc_conf == NULL) {

0 commit comments

Comments
 (0)