detect: run buffer setup callback before validate

pull/3013/head
Victor Julien 9 years ago
parent bb65a48edd
commit ac57bd8149

@ -1700,6 +1700,14 @@ static Signature *SigInitHelper(DetectEngineCtx *de_ctx, const char *sigstr,
SigBuildAddressMatchArray(sig);
/* run buffer type callbacks if any */
const int nlists = DetectBufferTypeMaxId();
int x;
for (x = 0; x < nlists; x++) {
if (sig->init_data->smlists[x])
DetectBufferRunSetupCallback(x, sig);
}
/* validate signature, SigValidate will report the error reason */
if (SigValidate(de_ctx, sig) == 0) {
goto error;

@ -3034,14 +3034,6 @@ int SigAddressPrepareStage1(DetectEngineCtx *de_ctx)
}
}
}
/* run buffer type callbacks if any */
int x;
for (x = 0; x < nlists; x++) {
if (tmp_s->init_data->smlists[x])
DetectBufferRunSetupCallback(x, tmp_s);
}
de_ctx->sig_cnt++;
}

Loading…
Cancel
Save