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 2018/05/09 10:30:53 UTC

[trafficserver] 03/06: Fixes uninitialized argument value use in HttpTransact::issue_revalidate

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 34199fb784856a42814c8d20e562ef8b026a21dd
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon May 7 14:48:33 2018 +0100

    Fixes uninitialized argument value use in HttpTransact::issue_revalidate
    
    issue found by clang-analyzer
    
    (cherry picked from commit 7d5e0a1f03528d36b89f51387da18a652067004e)
---
 proxy/http/HttpTransact.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index bcd383b..2178b33 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2360,8 +2360,9 @@ HttpTransact::issue_revalidate(State *s)
       // make this a conditional request
       int length;
       const char *str = c_resp->value_get(MIME_FIELD_LAST_MODIFIED, MIME_LEN_LAST_MODIFIED, &length);
-
-      s->hdr_info.server_request.value_set(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE, str, length);
+      if (str) {
+        s->hdr_info.server_request.value_set(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE, str, length);
+      }
       if (!s->cop_test_page)
         DUMP_HEADER("http_hdrs", &s->hdr_info.server_request, s->state_machine_id, "Proxy's Request (Conditionalized)");
     }

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.