]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
inspect: debug validation to ensure correct argument
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 13 Sep 2021 10:27:51 +0000 (12:27 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 15 Nov 2021 12:24:15 +0000 (13:24 +0100)
(cherry picked from commit 689ac97d7225fd43b64c103034b1fdf63fa4d324)

src/detect-engine.c

index 97e8c1e962f7578fd035fdefd91ebff32dd146ef..70f766e2b17cf6161dba9b2586a7b0abb039c927 100644 (file)
@@ -1154,7 +1154,10 @@ void InspectionBufferSetupMulti(InspectionBuffer *buffer, const DetectEngineTran
 void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id,
         InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
 {
+#ifdef DEBUG_VALIDATION
     DEBUG_VALIDATE_BUG_ON(buffer->multi);
+    DEBUG_VALIDATE_BUG_ON(buffer != InspectionBufferGet(det_ctx, list_id));
+#endif
     if (buffer->inspect == NULL) {
 #ifdef UNITTESTS
         if (det_ctx && list_id != -1)