From 1de1413863d06f9409d756af64a98f5370fef51b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 27 Feb 2017 12:27:11 +0100 Subject: [PATCH] stream: validate SACK right edge to be in window --- src/stream-tcp-sack.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stream-tcp-sack.c b/src/stream-tcp-sack.c index d3be60e920..ab0ad57faa 100644 --- a/src/stream-tcp-sack.c +++ b/src/stream-tcp-sack.c @@ -271,13 +271,12 @@ int StreamTcpSackUpdatePacket(TcpStream *stream, Packet *p) goto next; } - /** \todo need a metric to a check for a right edge limit */ -/* - if (SEQ_GT(ntohl(sack_rec->re), stream->next_seq)) { - SCLogDebug("record beyond next_seq %u", stream->next_seq); + if (SEQ_GT(ntohl(sack_rec->re), stream->next_win)) { + SCLogDebug("record %u:%u beyond next_win %u", + ntohl(sack_rec->le), ntohl(sack_rec->re), stream->next_win); goto next; } -*/ + if (SEQ_GEQ(ntohl(sack_rec->le), ntohl(sack_rec->re))) { SCLogDebug("invalid record: le >= re"); goto next; -- 2.47.2