comparison src/http/modules/ngx_http_ssi_filter_module.c @ 1566:f00b905cb70b

fix segfault when $date_local or $date_gmt are used outside ssi module
author Igor Sysoev <igor@sysoev.ru>
date Sun, 14 Oct 2007 19:04:23 +0000
parents 4c43e25d11ea
children bef67c6abbe7
comparison
equal deleted inserted replaced
1565:4c43e25d11ea 1566:f00b905cb70b
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 }