From: Philippe Antoine Date: Wed, 29 Sep 2021 15:22:57 +0000 (+0200) Subject: http: range: remove assert that can happen X-Git-Tag: suricata-7.0.0-beta1~1320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78cf9cfc5f882c7f7348e501c3ece03f0699b343;p=thirdparty%2Fsuricata.git http: range: remove assert that can happen --- diff --git a/src/app-layer-htp-range.c b/src/app-layer-htp-range.c index 271aa10bd4..2e4e628d3e 100644 --- a/src/app-layer-htp-range.c +++ b/src/app-layer-htp-range.c @@ -421,11 +421,12 @@ int HttpRangeAppendData(HttpRangeContainerBlock *c, const uint8_t *data, uint32_ SCLogDebug("update files (FileAppendData)"); return FileAppendData(c->files, data, len); } - // If we are not in the previous cases, only one case remains - DEBUG_VALIDATE_BUG_ON(c->current == NULL); - // So we have a current allocated buffer to copy to - // in the case of an unordered range being handled + // Maybe we were in the skipping case, + // but we get more data than expected and had set c->toskip = 0 + // so we need to check for last case with something to do if (c->current) { + // So we have a current allocated buffer to copy to + // in the case of an unordered range being handled SCLogDebug("update current: adding %u bytes to block %p", len, c); // GAP "data" if (data == NULL) {