]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
icmpv6: bail out for icmpv6.hdr keyword if not ICMPv6
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 18 Dec 2020 13:21:16 +0000 (14:21 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 27 Feb 2021 17:46:10 +0000 (18:46 +0100)
(cherry picked from commit ddb4d289ae00908d8f25fdd3afbcd5a1da2111a6)

src/detect-icmpv6hdr.c

index f892f5921b5f68650aca1b97006222e3c2f0498a..7de83dc5f1994ed3f8350022c9a3f323e8b4a23e 100644 (file)
@@ -105,7 +105,10 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
     InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
     if (buffer->inspect == NULL) {
         uint32_t hlen = ICMPV6_HEADER_LEN;
-        DEBUG_VALIDATE_BUG_ON(p->icmpv6h == NULL);
+        if (p->icmpv6h == NULL) {
+            // DETECT_PROTO_IPV6 does not prefilter
+            return NULL;
+        }
         if (((uint8_t *)p->icmpv6h + (ptrdiff_t)hlen) >
                 ((uint8_t *)GET_PKT_DATA(p) + (ptrdiff_t)GET_PKT_LEN(p)))
         {