From: Victor Julien Date: Sun, 5 Nov 2017 21:25:11 +0000 (+0100) Subject: detect: run buffer setup callback before validate X-Git-Tag: suricata-4.1.0-beta1~552 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac57bd814968023595381a53a59e86ff3448a701;p=thirdparty%2Fsuricata.git detect: run buffer setup callback before validate --- diff --git a/src/detect-parse.c b/src/detect-parse.c index 0310691282..abf6a8a199 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -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; diff --git a/src/detect.c b/src/detect.c index a96362a2d7..605b2a97f3 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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++; }