You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/01/30 07:35:07 UTC

[trafficserver] branch 7.1.x updated: Initialize redir_len, compiler warnings

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


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 65a5a89  Initialize redir_len, compiler warnings
65a5a89 is described below

commit 65a5a8938923e8e96ebd922669e7b41ab1ecfc14
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Jan 22 11:00:35 2019 -0700

    Initialize redir_len, compiler warnings
    
    It turns out, t_state.hdr_info.client_response.value_get() can actually
    fail, at which point, redir_len is undefined. I don't know if this
    happens in reality though, but has made wrong assumptions.
    
    (cherry picked from commit c7efd7cb07098685505ba882a2a2c8fc9189611c)
---
 proxy/http/HttpSM.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index ebdc6b9..61b100f 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -7782,7 +7782,7 @@ HttpSM::do_redirect()
         HTTP_INCREMENT_DYN_STAT(http_total_x_redirect_stat);
       } else {
         // get the location header and setup the redirect
-        int redir_len;
+        int redir_len   = 0;
         char *redir_url = (char *)t_state.hdr_info.client_response.value_get(MIME_FIELD_LOCATION, MIME_LEN_LOCATION, &redir_len);
         redirect_request(redir_url, redir_len);
       }