]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http: range: remove assert that can happen
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 29 Sep 2021 15:22:57 +0000 (17:22 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 29 Sep 2021 20:38:43 +0000 (22:38 +0200)
src/app-layer-htp-range.c

index 271aa10bd444a2244c5b52241b559c7d2ffed244..2e4e628d3e73ebf8f3d2efdb581a1b05ab4aae4b 100644 (file)
@@ -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) {