comparison src/http/modules/ngx_http_ssi_filter_module.c @ 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 bef67c6abbe7
comparison
equal deleted inserted replaced
1714:6b81bbc36eaf 1715:7ecf7e78e1ab
2646 2646
2647 tp = ngx_timeofday(); 2647 tp = ngx_timeofday();
2648 2648
2649 ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module); 2649 ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module);
2650 2650
2651 if (ctx->timefmt.len == sizeof("%s") - 1 2651 if (ctx == NULL
2652 && ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's') 2652 || (ctx->timefmt.len == sizeof("%s") - 1
2653 && ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's'))
2653 { 2654 {
2654 v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN); 2655 v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN);
2655 if (v->data == NULL) { 2656 if (v->data == NULL) {
2656 return NGX_ERROR; 2657 return NGX_ERROR;
2657 } 2658 }