aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-10-14 19:04:23 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-10-14 19:04:23 +0000
commit8de766328f02099e44b173a35e3c31a6519de2dc (patch)
tree64379c7f64a47ae70036017963af28e3bd1402a2
parent2d3f3f6eb682a407700a7fcadc67ad8e703249da (diff)
downloadnginx-8de766328f02099e44b173a35e3c31a6519de2dc.tar.gz
nginx-8de766328f02099e44b173a35e3c31a6519de2dc.zip
fix segfault when $date_local or $date_gmt are used outside ssi module
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c5
1 files changed, 3 insertions, 2 deletions
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) {