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/08 11:10:26 UTC

[trafficserver] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d5e0a1  Fixes uninitialized argument value use in HttpTransact::issue_revalidate
7d5e0a1 is described below

commit 7d5e0a1f03528d36b89f51387da18a652067004e
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
---
 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 acca034..eae6f70 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2259,8 +2259,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.