mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 14:13:33 -06:00
fix segfault when $date_local or $date_gmt are used outside ssi module
This commit is contained in:
parent
2d3f3f6eb6
commit
8de766328f
@ -2648,8 +2648,9 @@ ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
|
|||||||
|
|
||||||
ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module);
|
ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module);
|
||||||
|
|
||||||
if (ctx->timefmt.len == sizeof("%s") - 1
|
if (ctx == NULL
|
||||||
&& ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's')
|
|| (ctx->timefmt.len == sizeof("%s") - 1
|
||||||
|
&& ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's'))
|
||||||
{
|
{
|
||||||
v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN);
|
v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN);
|
||||||
if (v->data == NULL) {
|
if (v->data == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user