You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2015/04/21 00:49:48 UTC

trafficserver git commit: Add a check to block a clang-analyzer null dereference.

Repository: trafficserver
Updated Branches:
  refs/heads/master 07e920707 -> 0694b3537


Add a check to block a clang-analyzer null dereference.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0694b353
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0694b353
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0694b353

Branch: refs/heads/master
Commit: 0694b3537ad623c1d3175ecd5e1881a1fd97affc
Parents: 07e9207
Author: shinrich <sh...@yahoo-inc.com>
Authored: Mon Apr 20 17:47:54 2015 -0500
Committer: shinrich <sh...@yahoo-inc.com>
Committed: Mon Apr 20 17:49:34 2015 -0500

----------------------------------------------------------------------
 proxy/http/HttpClientSession.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0694b353/proxy/http/HttpClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 742a883..c332e64 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -220,7 +220,8 @@ HttpClientSession::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *
   /* conditionally set the tcp initial congestion window
      before our first write. */
   DebugHttpSsn("tcp_init_cwnd_set %d\n", (int)tcp_init_cwnd_set);
-  if (!tcp_init_cwnd_set) {
+  // Checking c to avoid clang detected NULL derference path
+  if (c && !tcp_init_cwnd_set) {
     tcp_init_cwnd_set = true;
     set_tcp_init_cwnd();
   }