From 804da19a3680e9d234e7a9983a5ad671f94b5f58 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 5 Oct 2009 15:18:34 +0200 Subject: [PATCH] Fix flowbits match being unable to deal with a packet without a flow. --- src/detect-flowbits.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index 6ce13ab755..24e88be153 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -70,25 +70,40 @@ error: static int DetectFlowbitMatchToggle (Packet *p, DetectFlowbitsData *fd) { + if (p->flow == NULL) + return 0; + FlowBitToggle(p->flow,fd->idx); return 1; } static int DetectFlowbitMatchUnset (Packet *p, DetectFlowbitsData *fd) { + if (p->flow == NULL) + return 0; + FlowBitUnset(p->flow,fd->idx); return 1; } static int DetectFlowbitMatchSet (Packet *p, DetectFlowbitsData *fd) { + if (p->flow == NULL) + return 0; + FlowBitSet(p->flow,fd->idx); return 1; } static int DetectFlowbitMatchIsset (Packet *p, DetectFlowbitsData *fd) { + if (p->flow == NULL) + return 0; + return FlowBitIsset(p->flow,fd->idx); } static int DetectFlowbitMatchIsnotset (Packet *p, DetectFlowbitsData *fd) { + if (p->flow == NULL) + return 0; + return FlowBitIsnotset(p->flow,fd->idx); }