From 17b0e8722aa7b04491a076cc8d4a62efb3e56e0a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 22 Dec 2006 13:05:07 +0000 Subject: [PATCH] fix segfault --- src/http/modules/perl/nginx.xs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index 558922c38..1c78eabb6 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -387,7 +387,10 @@ request_body(r) ngx_http_perl_set_request(r); - if (r->request_body->temp_file || r->request_body->bufs == NULL) { + if (r->request_body == NULL + || r->request_body->temp_file + || r->request_body->bufs == NULL) + { XSRETURN_UNDEF; } @@ -411,7 +414,7 @@ request_body_file(r) ngx_http_perl_set_request(r); - if (r->request_body->temp_file == NULL) { + if (r->request_body == NULL || r->request_body->temp_file == NULL) { XSRETURN_UNDEF; }