From 6ef2ad0fbde1d9cc0dd234b4e8251e3e3e281e91 Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Tue, 6 Jun 2023 13:59:46 -0600 Subject: [PATCH] Fix crash on H3 transaction This closes #9782 --- proxy/http3/Http3Transaction.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/proxy/http3/Http3Transaction.cc b/proxy/http3/Http3Transaction.cc index 38f64118c15..841ace66004 100644 --- a/proxy/http3/Http3Transaction.cc +++ b/proxy/http3/Http3Transaction.cc @@ -252,8 +252,10 @@ HQTransaction::_unschedule_read_ready_event() void HQTransaction::_close_read_ready_event(Event *e) { - ink_assert(this->_read_ready_event == e); - this->_read_ready_event = nullptr; + if (e) { + ink_assert(this->_read_ready_event == e); + this->_read_ready_event = nullptr; + } } void @@ -279,8 +281,10 @@ HQTransaction::_unschedule_read_complete_event() void HQTransaction::_close_read_complete_event(Event *e) { - ink_assert(this->_read_complete_event == e); - this->_read_complete_event = nullptr; + if (e) { + ink_assert(this->_read_complete_event == e); + this->_read_complete_event = nullptr; + } } void @@ -306,8 +310,10 @@ HQTransaction::_unschedule_write_ready_event() void HQTransaction::_close_write_ready_event(Event *e) { - ink_assert(this->_write_ready_event == e); - this->_write_ready_event = nullptr; + if (e) { + ink_assert(this->_write_ready_event == e); + this->_write_ready_event = nullptr; + } } void @@ -333,8 +339,10 @@ HQTransaction::_unschedule_write_complete_event() void HQTransaction::_close_write_complete_event(Event *e) { - ink_assert(this->_write_complete_event == e); - this->_write_complete_event = nullptr; + if (e) { + ink_assert(this->_write_complete_event == e); + this->_write_complete_event = nullptr; + } } /**