comparison src/http/modules/ngx_http_ssi_filter_module.c @ 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 7a6456398fc3
children f583559aadc7
comparison
equal deleted inserted replaced
7025:7206c3630310 7026:e699e6b6d76c
2386 2386
2387 if (value) { 2387 if (value) {
2388 ctx->timefmt.len = value->len; 2388 ctx->timefmt.len = value->len;
2389 ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1); 2389 ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
2390 if (ctx->timefmt.data == NULL) { 2390 if (ctx->timefmt.data == NULL) {
2391 return NGX_HTTP_SSI_ERROR; 2391 return NGX_ERROR;
2392 } 2392 }
2393 2393
2394 ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1); 2394 ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1);
2395 } 2395 }
2396 2396