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/10/28 18:16:46 UTC

[trafficserver] branch 9.0.x updated: clang-analyzer: Add a null check

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

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 58e2334  clang-analyzer: Add a null check
58e2334 is described below

commit 58e2334ba7ab1d80868e89327c68952d66e9bcfa
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Thu Oct 10 13:23:13 2019 -0700

    clang-analyzer: Add a null check
    
    (cherry picked from commit cbc46ac4570ac034189d83de4e28c4b495545737)
---
 proxy/hdrs/MIME.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 9f9c57c..7107401 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -485,6 +485,8 @@ mime_hdr_set_accelerators_and_presence_bits(MIMEHdrImpl *mh, MIMEField *field)
     return;
   }
 
+  ink_assert(mh);
+
   mime_hdr_presence_set(mh, field->m_wks_idx);
 
   slot_id = hdrtoken_index_to_slotid(field->m_wks_idx);
@@ -1570,6 +1572,7 @@ mime_hdr_field_attach(MIMEHdrImpl *mh, MIMEField *field, int check_for_dups, MIM
 void
 mime_hdr_field_detach(MIMEHdrImpl *mh, MIMEField *field, bool detach_all_dups)
 {
+  ink_assert(mh);
   MIMEField *next_dup = field->m_next_dup;
 
   // If this field is already detached, there's nothing to do. There must