]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4180: stream_tcp: add check to verify seglist head is not nullptr and...
authorDavis McPherson -X (davmcphe - XORIANT CORPORATION at Cisco) <davmcphe@cisco.com>
Thu, 8 Feb 2024 19:00:05 +0000 (19:00 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Thu, 8 Feb 2024 19:00:05 +0000 (19:00 +0000)
Merge in SNORT/snort3 from ~DAVMCPHE/snort3:CSCwi80961_verify_seglist_not_empty to master

Squashed commit of the following:

commit 9c06b0a65fb09348f660781170de380214f8eea5
Author: davis mcpherson <davmcphe@cisco.com>
Date:   Mon Jan 29 19:09:18 2024 -0500

    stream_tcp: add check to verify seglist head is not nullptr and only initialize PAF when it is not

src/stream/tcp/tcp_reassembler.h

index 8dfd0787f0ddc84fe62e7981f8ed698d193b0022..10ecda6c4467f659795702f6b20524c8679e67f9 100644 (file)
@@ -56,6 +56,10 @@ public:
     void skip_midstream_pickup_seglist_hole(TcpReassemblerState&, TcpSegmentDescriptor&);
     void initialize_paf(TcpReassemblerState& trs)
     {
+        // only initialize if we have a data segment queued
+        if ( !trs.sos.seglist.head )
+            return;
+
         if ( !paf_initialized(&trs.paf_state) or SEQ_GT(trs.paf_state.seq, trs.sos.seglist.head->i_seq) )
             paf_initialize(&trs.paf_state, trs.sos.seglist.head->i_seq);
     }