diff options
author | Ruslan Ermilov <ru@nginx.com> | 2017-11-16 13:20:47 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2017-11-16 13:20:47 +0300 |
commit | cdbdbbd8423ab96c89c034d879b16b1a931eb38a (patch) | |
tree | 1c5143d5d0a158b63cf8d30531827fbb825af0c1 | |
parent | d303a95594fdbca28b241e53d0346d5965cfd757 (diff) | |
download | nginx-cdbdbbd8423ab96c89c034d879b16b1a931eb38a.tar.gz nginx-cdbdbbd8423ab96c89c034d879b16b1a931eb38a.zip |
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.
-rw-r--r-- | src/http/modules/ngx_http_xslt_filter_module.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c index fae589550..ea7ce2a5c 100644 --- a/src/http/modules/ngx_http_xslt_filter_module.c +++ b/src/http/modules/ngx_http_xslt_filter_module.c @@ -686,8 +686,19 @@ ngx_http_xslt_params(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx, * 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) { |