Skip to content

Commit

Permalink
icmpv6: bail out for icmpv6.hdr keyword if not ICMPv6
Browse files Browse the repository at this point in the history
(cherry picked from commit ddb4d28)
  • Loading branch information
catenacyber authored and victorjulien committed Feb 27, 2021
1 parent c94125b commit 2828e29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/detect-icmpv6hdr.c
Expand Up @@ -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)))
{
Expand Down

0 comments on commit 2828e29

Please sign in to comment.