detect/flowint: harden code

Make sure packet has a flow.

Related to bug #2288.
pull/3042/head
Victor Julien 7 years ago
parent 2a1a664f3c
commit dd015669c7

@ -95,6 +95,9 @@ int DetectFlowintMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
uint32_t targetval;
int ret = 0;
if (p->flow == NULL)
return 0;
/** ATM If we are going to compare the current var with another
* that doesn't exist, the default value will be zero;
* if you don't want this behaviour, you can use the keyword

@ -53,6 +53,9 @@ static void FlowVarUpdateInt(FlowVar *fv, uint32_t value)
*/
FlowVar *FlowVarGet(Flow *f, uint16_t idx)
{
if (f == NULL)
return NULL;
GenericVar *gv = f->flowvar;
for ( ; gv != NULL; gv = gv->next) {

Loading…
Cancel
Save