summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2017-06-07 15:21:42 +0300
committerSergey Kandaurov <pluknet@nginx.com>2017-06-07 15:21:42 +0300
commitdec513d6e47aa883e2dbeaeb70c122e37b9abe70 (patch)
tree1e2b7908ab89e682ae5808eedd881175d9df7e2f
parent51a4a414ca051c779ac90a566bd50c0a1ecd6a40 (diff)
downloadnginx-dec513d6e47aa883e2dbeaeb70c122e37b9abe70.tar.gz
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().
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index 6fb1fbe45..b92ad4c02 100644
--- 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 *r, ngx_http_ssi_ctx_t *ctx,
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);