From: Igor Sysoev Date: Wed, 12 Dec 2007 16:58:13 +0000 (+0000) Subject: r1567 merge: X-Git-Tag: release-0.5.34~20 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=8b8c017d058ca0fbf06c910341117df5394834a9;p=nginx.git r1567 merge: fix segfault when $date_local or $date_gmt are used outside ssi module --- diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index 8a05dfd4e..60aed18f8 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -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); - if (ctx->timefmt.len == sizeof("%s") - 1 - && ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's') + if (ctx == NULL + || (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); if (v->data == NULL) {