From e7faaf3ea4be82540cacd21c4722f02d754fff44 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 19 Aug 2020 22:15:11 +0000 Subject: [PATCH] Protect TSActionCancel from null INKContInternal actions --- 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 f5d8891f493..9dd2c3d5535 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; }