From b5c19bc1f86aa67ac2e3e1e24909a5b48baf0b7d Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sat, 28 Dec 2013 16:06:58 +0100 Subject: [PATCH] plugins/php: check return value of uwsgi_response_prepare_headers Reported by Coverity as CID #1100794 --- plugins/php/php_plugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c index 16740b24..e369ed5c 100644 --- a/plugins/php/php_plugin.c +++ b/plugins/php/php_plugin.c @@ -92,11 +92,13 @@ static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers) int hrc = SG(sapi_headers).http_response_code; if (!hrc) hrc = 200; uwsgi_num2str2n(hrc, status, 4); - uwsgi_response_prepare_headers(wsgi_req, status, 3); + if (uwsgi_response_prepare_headers(wsgi_req, status, 3)) + return SAPI_HEADER_SEND_FAILED; } else { char *sl = SG(sapi_headers).http_status_line; - uwsgi_response_prepare_headers(wsgi_req, sl + 9 , strlen(sl + 9)); + if (uwsgi_response_prepare_headers(wsgi_req, sl + 9 , strlen(sl + 9))) + return SAPI_HEADER_SEND_FAILED; } h = zend_llist_get_first_ex(&sapi_headers->headers, &pos);