Skip to content

Commit

Permalink
stream: fix stream pruning being too aggressive
Browse files Browse the repository at this point in the history
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
  • Loading branch information
victorjulien committed Jan 13, 2022
1 parent 544ff0f commit 78f5e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util-streaming-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static void SBBPrune(StreamingBuffer *sb)
StreamingBufferBlock *sbb = NULL, *safe = NULL;
RB_FOREACH_SAFE(sbb, SBB, &sb->sbb_tree, safe) {
/* completely beyond window, we're done */
if (sbb->offset > sb->stream_offset) {
if (sbb->offset >= sb->stream_offset) {
sb->head = sbb;
break;
}
Expand Down

0 comments on commit 78f5e08

Please sign in to comment.