Mercurial > hg > nginx
changeset 7026:e699e6b6d76c
SSI: return NGX_ERROR when timefmt memory allocation failed.
Previously, when using NGX_HTTP_SSI_ERROR, error was ignored in ssi processing,
thus timefmt could be accessed later in ngx_http_ssi_date_gmt_local_variable()
as part of "set" handler, or NULL format pointer could be passed to strftime().
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 07 Jun 2017 15:21:42 +0300 |
parents | 7206c3630310 |
children | 6d0e0d982ec0 |
files | src/http/modules/ngx_http_ssi_filter_module.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -2388,7 +2388,7 @@ ngx_http_ssi_config(ngx_http_request_t * ctx->timefmt.len = value->len; ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1); if (ctx->timefmt.data == NULL) { - return NGX_HTTP_SSI_ERROR; + return NGX_ERROR; } ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1);