comparison src/http/modules/ngx_http_xslt_filter_module.c @ 4946:2570296374b4

Xslt: prevented infinite loop. If XSLT transformation failed and error 500 was handled in the same location, an infinite loop occured that exhausted the stack.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 06 Dec 2012 21:22:58 +0000
parents 4a18bf1833a9
children 2139768ee404
comparison
equal deleted inserted replaced
4945:ae3ebf5ac8cd 4946:2570296374b4
305 ngx_pool_cleanup_t *cln; 305 ngx_pool_cleanup_t *cln;
306 306
307 ctx->done = 1; 307 ctx->done = 1;
308 308
309 if (b == NULL) { 309 if (b == NULL) {
310 return ngx_http_filter_finalize_request(r, NULL, 310 return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
311 NGX_HTTP_INTERNAL_SERVER_ERROR); 311 NGX_HTTP_INTERNAL_SERVER_ERROR);
312 } 312 }
313 313
314 cln = ngx_pool_cleanup_add(r->pool, 0); 314 cln = ngx_pool_cleanup_add(r->pool, 0);
315 315
316 if (cln == NULL) { 316 if (cln == NULL) {
317 ngx_free(b->pos); 317 ngx_free(b->pos);
318 return ngx_http_filter_finalize_request(r, NULL, 318 return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
319 NGX_HTTP_INTERNAL_SERVER_ERROR); 319 NGX_HTTP_INTERNAL_SERVER_ERROR);
320 } 320 }
321 321
322 if (r == r->main) { 322 if (r == r->main) {
323 r->headers_out.content_length_n = b->last - b->pos; 323 r->headers_out.content_length_n = b->last - b->pos;