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 2020/08/26 21:07:59 UTC

[trafficserver] branch master updated: Protect TSActionCancel from null INKContInternal actions (#7128)

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 8a08586  Protect TSActionCancel from null INKContInternal actions (#7128)
8a08586 is described below

commit 8a0858603d2726aa653bc02787b5eee4956449ca
Author: Susan Hinrichs <sh...@yahoo-inc.com>
AuthorDate: Wed Aug 26 16:07:50 2020 -0500

    Protect TSActionCancel from null INKContInternal actions (#7128)
    
    Co-authored-by: Susan Hinrichs <sh...@verizonmedia.com>
---
 src/traffic_server/InkAPI.cc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index f5d8891..9dd2c3d 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -6820,11 +6820,20 @@ TSActionCancel(TSAction actionp)
   Action *thisaction;
   INKContInternal *i;
 
+  // Nothing to cancel
+  if (actionp == nullptr) {
+    return;
+  }
+
   /* This is a hack. Should be handled in ink_types */
   if ((uintptr_t)actionp & 0x1) {
     thisaction = (Action *)((uintptr_t)actionp - 1);
-    i          = (INKContInternal *)thisaction->continuation;
-    i->handle_event_count(EVENT_IMMEDIATE);
+    if (thisaction) {
+      i = (INKContInternal *)thisaction->continuation;
+      i->handle_event_count(EVENT_IMMEDIATE);
+    } else { // The action pointer for an INKContInternal was effectively null, just go away
+      return;
+    }
   } else {
     thisaction = (Action *)actionp;
   }