From: Victor Julien Date: Thu, 30 Jul 2020 12:43:03 +0000 (+0200) Subject: stream: fix endless loop in traffic with gaps X-Git-Tag: suricata-6.0.0-beta1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c8af9cb96e45fb2933f9082c416ba5e4397a209;p=thirdparty%2Fsuricata.git stream: fix endless loop in traffic with gaps --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 178c12dc60..4c5858aee0 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1108,6 +1108,7 @@ static int ReassembleUpdateAppLayer (ThreadVars *tv, StatsIncr(tv, ra_ctx->counter_tcp_reass_gap); /* AppLayerHandleTCPData has likely updated progress. */ + const bool no_progress_update = (app_progress == STREAM_APP_PROGRESS(*stream)); app_progress = STREAM_APP_PROGRESS(*stream); /* a GAP also consumes 'data required'. TODO perhaps we can use @@ -1121,8 +1122,10 @@ static int ReassembleUpdateAppLayer (ThreadVars *tv, } if (r < 0) return 0; - + if (no_progress_update) + break; continue; + } else if (mydata == NULL || mydata_len == 0) { /* Possibly a gap, but no new data. */ if ((p->flags & PKT_PSEUDO_STREAM_END) == 0 || ssn->state < TCP_CLOSED)