mirror of
https://github.com/nginx/nginx.git
synced 2024-11-24 04:49:01 +08:00
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().
This commit is contained in:
parent
51a4a414ca
commit
dec513d6e4
@ -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.len = value->len;
|
||||||
ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
|
ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
|
||||||
if (ctx->timefmt.data == NULL) {
|
if (ctx->timefmt.data == NULL) {
|
||||||
return NGX_HTTP_SSI_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1);
|
ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user