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 2014/03/31 19:05:14 UTC

git commit: TS-2679 background_fetch plugin can use uninitialized cont pointer

Repository: trafficserver
Updated Branches:
  refs/heads/master 6b8ead793 -> 5d55b7562


TS-2679 background_fetch plugin can use uninitialized cont pointer


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

Branch: refs/heads/master
Commit: 5d55b7562f78467db357d7c3dd05ff3fa8b4350b
Parents: 6b8ead7
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Mar 31 11:04:47 2014 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Mar 31 11:04:47 2014 -0600

----------------------------------------------------------------------
 CHANGES                                                   | 2 ++
 plugins/experimental/background_fetch/background_fetch.cc | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5d55b756/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f3b6149..9c9d073 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2679] background_fetch plugin can use uninitialized cont pointer.
+
   *) [TS-2675] metalink: Fix crash and plug memory leaks.
    Author: Jack Bates <ja...@nottheoilrig.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5d55b756/plugins/experimental/background_fetch/background_fetch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/background_fetch/background_fetch.cc b/plugins/experimental/background_fetch/background_fetch.cc
index 19fb4b9..4aeca11 100644
--- a/plugins/experimental/background_fetch/background_fetch.cc
+++ b/plugins/experimental/background_fetch/background_fetch.cc
@@ -214,7 +214,7 @@ static int bg_fetch_cont(TSCont contp, TSEvent event, void* edata);
 struct BGFetchData
 {
   BGFetchData(BGFetchConfig* cfg=&gConfig)
-    : hdr_loc(TS_NULL_MLOC), url_loc(TS_NULL_MLOC), _config(cfg)
+    : hdr_loc(TS_NULL_MLOC), url_loc(TS_NULL_MLOC), _cont(NULL),  _config(cfg)
   {
     mbuf = TSMBufferCreate();
   }
@@ -334,6 +334,8 @@ BGFetchData::initialize(TSMBuffer request, TSMLoc req_hdr, TSHttpTxn txnp)
 void
 BGFetchData::schedule()
 {
+  TSReleaseAssert(NULL == _cont);
+
   // Setup the continuation
   _cont = TSContCreate(bg_fetch_cont, NULL);
   TSContDataSet(_cont, static_cast<void*>(this));