From eb03cdea85654712e9dc94e5c1d98fc4f832faa4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 4 Jan 2023 20:39:24 +0100 Subject: [PATCH] stream: remove bug on from packet path (cherry picked from commit a00db15bd41ad08bec19ad3c252d1aab92c5c525) --- src/stream-tcp-list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream-tcp-list.c b/src/stream-tcp-list.c index 940928c64c..9bf4a42875 100644 --- a/src/stream-tcp-list.c +++ b/src/stream-tcp-list.c @@ -376,9 +376,9 @@ static int DoHandleDataOverlap(TcpStream *stream, const TcpSegment *list, const uint8_t *list_data; StreamingBufferSegmentGetData(&stream->sb, &list->sbseg, &list_data, &list_len); - if (list_data == NULL || list_len == 0) + DEBUG_VALIDATE_BUG_ON(list_len > USHRT_MAX); + if (list_data == NULL || list_len == 0 || list_len > USHRT_MAX) return 0; - BUG_ON(list_len > USHRT_MAX); /* if list seg is partially before base_seq, list_len (from stream) and * TCP_SEG_LEN(list) will not be the same */ -- 2.47.2