Skip to content

Commit

Permalink
Xslt: fixed parameters parsing (ticket #1416).
Browse files Browse the repository at this point in the history
If parameters were specified in xslt_stylesheet without variables,
any request except the first would cause an internal server error.
  • Loading branch information
mdocguard committed Nov 16, 2017
1 parent d303a95 commit cdbdbbd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/http/modules/ngx_http_xslt_filter_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit cdbdbbd

Please sign in to comment.