[trafficserver] 01/02: Add null pointer check to server response set status
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 45dcc892fae2103a4681f75927233dcf37ad0e0c Author: Matt MillsAuthorDate: Fri Aug 4 20:44:37 2017 -0600 Add null pointer check to server response set status (cherry picked from commit 84bc7ab86a020c1ff418014ac65da9f0483deafc) --- plugins/experimental/ts_lua/ts_lua_server_response.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/experimental/ts_lua/ts_lua_server_response.c b/plugins/experimental/ts_lua/ts_lua_server_response.c index d3e5338..14501c6 100644 --- a/plugins/experimental/ts_lua/ts_lua_server_response.c +++ b/plugins/experimental/ts_lua/ts_lua_server_response.c @@ -291,7 +291,7 @@ ts_lua_server_response_set_status(lua_State *L) { int status; const char *reason; - int reason_len; + int reason_len = 0; ts_lua_http_ctx *http_ctx; @@ -302,7 +302,9 @@ ts_lua_server_response_set_status(lua_State *L) status = luaL_checkint(L, 1); reason = TSHttpHdrReasonLookup(status); - reason_len = strlen(reason); + if (reason) { + reason_len = strlen(reason); + } TSHttpHdrStatusSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, status); TSHttpHdrReasonSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, reason, reason_len); -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] 01/02: Add null pointer check to server response set status
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch 6.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit d97cb17a8c5e84a07550b78d7c53d224686bcdf7 Author: Matt MillsAuthorDate: Fri Aug 4 20:44:37 2017 -0600 Add null pointer check to server response set status (cherry picked from commit 84bc7ab86a020c1ff418014ac65da9f0483deafc) --- plugins/experimental/ts_lua/ts_lua_server_response.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/experimental/ts_lua/ts_lua_server_response.c b/plugins/experimental/ts_lua/ts_lua_server_response.c index c4abd41..7c87342 100644 --- a/plugins/experimental/ts_lua/ts_lua_server_response.c +++ b/plugins/experimental/ts_lua/ts_lua_server_response.c @@ -243,7 +243,7 @@ ts_lua_server_response_set_status(lua_State *L) { int status; const char *reason; - int reason_len; + int reason_len = 0; ts_lua_http_ctx *http_ctx; @@ -254,7 +254,9 @@ ts_lua_server_response_set_status(lua_State *L) status = luaL_checkint(L, 1); reason = TSHttpHdrReasonLookup(status); - reason_len = strlen(reason); + if (reason) { + reason_len = strlen(reason); + } TSHttpHdrStatusSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, status); TSHttpHdrReasonSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, reason, reason_len); -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] 01/02: Add null pointer check to server response set status
This is an automated email from the ASF dual-hosted git repository. kichan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 84bc7ab86a020c1ff418014ac65da9f0483deafc Author: Matt MillsAuthorDate: Fri Aug 4 20:44:37 2017 -0600 Add null pointer check to server response set status --- plugins/experimental/ts_lua/ts_lua_server_response.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/experimental/ts_lua/ts_lua_server_response.c b/plugins/experimental/ts_lua/ts_lua_server_response.c index d3e5338..14501c6 100644 --- a/plugins/experimental/ts_lua/ts_lua_server_response.c +++ b/plugins/experimental/ts_lua/ts_lua_server_response.c @@ -291,7 +291,7 @@ ts_lua_server_response_set_status(lua_State *L) { int status; const char *reason; - int reason_len; + int reason_len = 0; ts_lua_http_ctx *http_ctx; @@ -302,7 +302,9 @@ ts_lua_server_response_set_status(lua_State *L) status = luaL_checkint(L, 1); reason = TSHttpHdrReasonLookup(status); - reason_len = strlen(reason); + if (reason) { + reason_len = strlen(reason); + } TSHttpHdrStatusSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, status); TSHttpHdrReasonSet(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, reason, reason_len); -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .