From 473b4f1e574d4a207b7649f124f2be781c1fa579 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sat, 28 Dec 2013 16:11:59 +0100 Subject: [PATCH] plugins/lua: check return value of uwsgi_response_prepare_headers Reported by Coverity as CID #1100802 --- plugins/lua/lua_plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/lua/lua_plugin.c b/plugins/lua/lua_plugin.c index 730676c6..ce78fda6 100644 --- a/plugins/lua/lua_plugin.c +++ b/plugins/lua/lua_plugin.c @@ -798,7 +798,8 @@ static int uwsgi_lua_request(struct wsgi_request *wsgi_req) { // send status if (lua_type(L, -3) == LUA_TSTRING || lua_type(L, -3) == LUA_TNUMBER) { http = lua_tolstring(L, -3, &slen); - uwsgi_response_prepare_headers(wsgi_req, (char *) http, slen); + if (uwsgi_response_prepare_headers(wsgi_req, (char *) http, slen)) + return -1; } else { uwsgi_log("[uwsgi-lua] invalid response status !!!\n");