From: Shravan Rangarajuvenkata (shrarang) Date: Fri, 24 Jan 2020 18:37:08 +0000 (+0000) Subject: Merge pull request #1962 in SNORT/snort3 from ~THOPETER/snort3:h2i_xtra_crash to... X-Git-Tag: 3.0.0-268~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c64ddc611b89b738111b9cf698ce4d1b6727b2cf;p=thirdparty%2Fsnort3.git Merge pull request #1962 in SNORT/snort3 from ~THOPETER/snort3:h2i_xtra_crash to master Squashed commit of the following: commit cc0f3d5419cb13e11168d1ca6591ce314c706b50 Author: Tom Peters Date: Fri Jan 24 12:30:07 2020 -0500 http_inspect: patch H2I-related xtra data crash --- diff --git a/src/service_inspectors/http_inspect/http_context_data.cc b/src/service_inspectors/http_inspect/http_context_data.cc index 15f432ed8..f59617a73 100644 --- a/src/service_inspectors/http_inspect/http_context_data.cc +++ b/src/service_inspectors/http_inspect/http_context_data.cc @@ -33,7 +33,9 @@ unsigned HttpContextData::ips_id = 0; HttpMsgSection* HttpContextData::get_snapshot(const Packet* p) { - if (Http2FlowData::inspector_id != 0) + // FIXIT-H checking for nullptr prevents a crash but it doesn't solve the problem of making + // xtra data work with H2I + if ((p != nullptr) && (Http2FlowData::inspector_id != 0)) { const Http2FlowData* const h2i_flow_data = (Http2FlowData*)p->flow->get_flow_data(Http2FlowData::inspector_id);