You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by vm...@apache.org on 2017/05/11 01:29:30 UTC

[trafficserver] branch master updated: coverity 1021972: Dereference after null check

This is an automated email from the ASF dual-hosted git repository.

vmamidi 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  258ce4f   coverity 1021972: Dereference after null check
258ce4f is described below

commit 258ce4f045fd14545faa27af9871769c598a6446
Author: Vijay Mamidi <vi...@yahoo.com>
AuthorDate: Wed May 10 14:21:45 2017 -0400

    coverity 1021972: Dereference after null check
---
 plugins/esi/esi.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/esi/esi.cc b/plugins/esi/esi.cc
index 91ea082..47c8ff7 100644
--- a/plugins/esi/esi.cc
+++ b/plugins/esi/esi.cc
@@ -333,7 +333,7 @@ ContData::getClientState()
           if (n_values == 1) {
             value = TSMimeHdrFieldValueStringGet(req_bufp, req_hdr_loc, field_loc, 0, &value_len);
 
-            if (nullptr != value || value_len) {
+            if (nullptr != value && value_len) {
               if (Utils::areEqual(name, name_len, TS_MIME_FIELD_ACCEPT_ENCODING, TS_MIME_LEN_ACCEPT_ENCODING) &&
                   Utils::areEqual(value, value_len, TS_HTTP_VALUE_GZIP, TS_HTTP_LEN_GZIP)) {
                 gzip_output = true;
@@ -342,7 +342,7 @@ ContData::getClientState()
           } else {
             for (int i = 0; i < n_values; ++i) {
               value = TSMimeHdrFieldValueStringGet(req_bufp, req_hdr_loc, field_loc, i, &value_len);
-              if (nullptr != value || value_len) {
+              if (nullptr != value && value_len) {
                 if (Utils::areEqual(name, name_len, TS_MIME_FIELD_ACCEPT_ENCODING, TS_MIME_LEN_ACCEPT_ENCODING) &&
                     Utils::areEqual(value, value_len, TS_HTTP_VALUE_GZIP, TS_HTTP_LEN_GZIP)) {
                   gzip_output = true;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].