]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
defrag: fix off by one
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 15 Jul 2024 07:52:00 +0000 (09:52 +0200)
committerVictor Julien <vjulien@oisf.net>
Wed, 25 Sep 2024 04:54:59 +0000 (06:54 +0200)
Ticket: 7067

This off by one could lead to an empty fragment being inserted
in the rb tree, which led to integer underflow

src/defrag.c

index eda41b76ccc110eac2aed7d5e64e9aa8b6baaaf2..e870c99068b5a8534b282a839d3b8a13c01c1777 100644 (file)
@@ -856,7 +856,7 @@ DefragInsertFrag(ThreadVars *tv, DecodeThreadVars *dtv, DefragTracker *tracker,
         }
     }
 
-    if (ltrim > data_len) {
+    if (ltrim >= data_len) {
         /* Full packet has been trimmed due to the overlap policy. Overlap
          * already set. */
         goto done;