# HG changeset patch # User Ruslan Ermilov # Date 1510827647 -10800 # Node ID 595a3de03e91742d26dda9778d3ad9072e73a0c6 # Parent 32f83fe5747b55ef341595b18069bee3891874d0 Xslt: fixed parameters parsing (ticket #1416). If parameters were specified in xslt_stylesheet without variables, any request except the first would cause an internal server error. diff -r 32f83fe5747b -r 595a3de03e91 src/http/modules/ngx_http_xslt_filter_module.c --- a/src/http/modules/ngx_http_xslt_filter_module.c Fri Oct 27 00:30:38 2017 +0800 +++ b/src/http/modules/ngx_http_xslt_filter_module.c Thu Nov 16 13:20:47 2017 +0300 @@ -686,8 +686,19 @@ * specified in xslt_stylesheet directives */ - p = string.data; - last = string.data + string.len; + if (param[i].value.lengths) { + p = string.data; + + } else { + p = ngx_pnalloc(r->pool, string.len + 1); + if (p == NULL) { + return NGX_ERROR; + } + + ngx_memcpy(p, string.data, string.len + 1); + } + + last = p + string.len; while (p && *p) {