From: Philippe Antoine Date: Thu, 14 Oct 2021 19:31:13 +0000 (+0200) Subject: range: move back files ownership in one case X-Git-Tag: suricata-7.0.0-beta1~1290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77604d86d6dea20e392098a874b7450c9659c0fb;p=thirdparty%2Fsuricata.git 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 --- 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