From: Steve Chew (stechew) Date: Fri, 22 Apr 2022 22:30:26 +0000 (+0000) Subject: Pull request #3391: mms: initialize BerElement X-Git-Tag: 3.1.28.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d7c8e4cdd2380e59c089b3a7d9cb8f8fcf8ac0d;p=thirdparty%2Fsnort3.git Pull request #3391: mms: initialize BerElement Merge in SNORT/snort3 from ~KATHARVE/snort3:mms_cppcheck to master Squashed commit of the following: commit 1e1b2363d1283c763c1a5d1b2eab6534673f14c3 Author: Katura Harvey Date: Fri Apr 22 15:57:32 2022 -0400 mms: add check that BerElement argument isn't null before calling BerReader::read --- diff --git a/src/service_inspectors/mms/tpkt/osi_pres_decode.cc b/src/service_inspectors/mms/tpkt/osi_pres_decode.cc index 3baf39570..51d743755 100644 --- a/src/service_inspectors/mms/tpkt/osi_pres_decode.cc +++ b/src/service_inspectors/mms/tpkt/osi_pres_decode.cc @@ -37,7 +37,7 @@ static TpktAppliSearchStateType decode_osi_pres_normal_mode_params(BerReader*, C bool process_next_ber_tag(BerReader* ber, BerElement* e, Cursor* tpkt_cur, BerTagProcessType process_type) { - if (ber->read(tpkt_cur->start(), *e)) + if (e and ber->read(tpkt_cur->start(), *e)) { // determine if the cursor needs to be incremented by only the header // length or both the header and payload length