Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/ngx_http_lua_initworkerby.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ ngx_http_lua_init_worker(ngx_cycle_t *cycle)

ngx_memcpy(fake_cycle, cycle, sizeof(ngx_cycle_t));

/*
* nginx clears cycle->old_cycle after ngx_init_cycle() completes.
* Since nginx 1.29.2, ngx_ssl_cache_fetch() accesses old_cycle->conf_ctx
* without a NULL guard, so we must ensure old_cycle is non-NULL.
* This avoids a NULL dereference when merge_loc_conf triggers
* ngx_ssl_trusted_certificate.
* Pointing to the current cycle is safe: the SSL cache is shared via
* conf_ctx, so cert lookups still find previously loaded entries.
*/
if (fake_cycle->old_cycle == NULL) {
fake_cycle->old_cycle = cycle;
}

ngx_queue_init(&fake_cycle->reusable_connections_queue);

if (ngx_array_init(&fake_cycle->listening, cycle->pool,
Expand Down
Loading