Skip to content

Commit 1823829

Browse files
authored
Merge branch 'openresty:master' into master
2 parents 9f5f654 + f4c76d8 commit 1823829

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎src/api/ngx_http_lua_api.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* Public API for other Nginx modules */
2020

2121

22-
#define ngx_http_lua_version 10029
22+
#define ngx_http_lua_version 10030
2323
#define NGX_HTTP_LUA_EXPORT_CO_CTX_CLEANUP 1
2424

2525

‎src/ngx_http_lua_initworkerby.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ ngx_http_lua_init_worker(ngx_cycle_t *cycle)
115115

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

118+
/*
119+
* nginx clears cycle->old_cycle after ngx_init_cycle() completes.
120+
* Since nginx 1.29.2, ngx_ssl_cache_fetch() accesses old_cycle->conf_ctx
121+
* without a NULL guard, so we must ensure old_cycle is non-NULL.
122+
* This avoids a NULL dereference when merge_loc_conf triggers
123+
* ngx_ssl_trusted_certificate.
124+
* Pointing to the current cycle is safe: the SSL cache is shared via
125+
* conf_ctx, so cert lookups still find previously loaded entries.
126+
*/
127+
if (fake_cycle->old_cycle == NULL) {
128+
fake_cycle->old_cycle = cycle;
129+
}
130+
118131
ngx_queue_init(&fake_cycle->reusable_connections_queue);
119132

120133
if (ngx_array_init(&fake_cycle->listening, cycle->pool,

‎t/138-balancer.t‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ hello world: HTTP/2.0
698698
--- no_error_log
699699
[error]
700700
[crit]
701+
--- skip_nginx: 4: < 1.29.4
701702
702703
703704
@@ -736,3 +737,4 @@ qr/502 Bad Gateway/
736737
[error]
737738
--- error_log eval
738739
qr/SSL_do_handshake.*(?:no application protocol|NO_APPLICATION_PROTOCOL).*SSL alert number 120\) while SSL handshaking to upstream/
740+
--- skip_nginx: 4: < 1.29.4

‎util/build.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ time ngx-build $force $version \
3737
--with-http_ssl_module \
3838
--add-module=$root/../ndk-nginx-module \
3939
--add-module=$root/../set-misc-nginx-module \
40-
--with-ld-opt="-L$PCRE2_LIB -L$OPENSSL_LIB -Wl,-rpath,$PCRE2_LIB:$LIBDRIZZLE_LIB:$OPENSSL_LIB" \
40+
--with-ld-opt="-L$PCRE2_LIB -L$OPENSSL_LIB -L$LUAJIT_LIB -Wl,-rpath,$PCRE2_LIB:$LIBDRIZZLE_LIB:$OPENSSL_LIB:$LUAJIT_LIB" \
4141
--without-mail_pop3_module \
4242
--without-mail_imap_module \
4343
--with-http_image_filter_module \

0 commit comments

Comments
 (0)