From 77604d86d6dea20e392098a874b7450c9659c0fb Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 14 Oct 2021 21:31:13 +0200 Subject: [PATCH] range: move back files ownership in one case In the case, we receive a range request with expected overlap then new bytes, but the response does not get to the new bytes, we are still skipping, but the HttpRangeContainerBlock had the ownership of the files, and need to give it back --- src/app-layer-htp-range.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app-layer-htp-range.c b/src/app-layer-htp-range.c index 2e4e628d3e..24777d3f99 100644 --- a/src/app-layer-htp-range.c +++ b/src/app-layer-htp-range.c @@ -506,6 +506,11 @@ File *HttpRangeClose(HttpRangeContainerBlock *c, uint16_t flags) } else if (c->toskip > 0) { // was only an overlapping range, truncated before new bytes SCLogDebug("c->toskip %" PRIu64, c->toskip); + if (c->files) { + // if we expected new bytes after overlap + c->container->files = c->files; + c->files = NULL; + } return NULL; } else { // we just finished an in-order block