]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3391: mms: initialize BerElement
authorSteve Chew (stechew) <stechew@cisco.com>
Fri, 22 Apr 2022 22:30:26 +0000 (22:30 +0000)
committerSteve Chew (stechew) <stechew@cisco.com>
Fri, 22 Apr 2022 22:30:26 +0000 (22:30 +0000)
Merge in SNORT/snort3 from ~KATHARVE/snort3:mms_cppcheck to master

Squashed commit of the following:

commit 1e1b2363d1283c763c1a5d1b2eab6534673f14c3
Author: Katura Harvey <katharve@cisco.com>
Date:   Fri Apr 22 15:57:32 2022 -0400

    mms: add check that BerElement argument isn't null before calling BerReader::read

src/service_inspectors/mms/tpkt/osi_pres_decode.cc

index 3baf39570f96531dc5f1bb33de7e068644fa566a..51d7437552bad27168a845a3d6b9746e00765e18 100644 (file)
@@ -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