Mercurial > hg > nginx
changeset 1715:7ecf7e78e1ab stable-0.5
r1567 merge:
fix segfault when $date_local or $date_gmt are used outside ssi module
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Dec 2007 16:58:13 +0000 |
parents | 6b81bbc36eaf |
children | a33e2a1a4e4c |
files | src/http/modules/ngx_http_ssi_filter_module.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_ssi_filter_module.c Wed Dec 12 16:57:36 2007 +0000 +++ b/src/http/modules/ngx_http_ssi_filter_module.c Wed Dec 12 16:58:13 2007 +0000 @@ -2648,8 +2648,9 @@ 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) {