Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/flowbit prefilter/v24 #12132

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SQUASH scan-build issues
victorjulien committed Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5c71c86fa5042230093a2d9079637f6948014d11
9 changes: 4 additions & 5 deletions src/detect-flowbits.c
Original file line number Diff line number Diff line change
@@ -690,7 +690,6 @@ static struct FBAnalyzer DetectFlowbitsAnalyzeForGroup(
if (max_fb_id == 0)
return fba;

#define MAX_SIDS 8
uint32_t array_size = max_fb_id + 1;
struct FBAnalyze *array = SCCalloc(array_size, sizeof(struct FBAnalyze));
if (array == NULL) {
@@ -709,9 +708,7 @@ static struct FBAnalyzer DetectFlowbitsAnalyzeForGroup(

int r = DetectFlowbitsAnalyzeSignature(s, &fba);
if (r < 0) {
SCFree(fba.array);
array = fba.array = NULL;
array_size = fba.array_size = 0;
FBAnalyzerFree(&fba);
return fba;
}
}
@@ -1217,9 +1214,11 @@ static int PrefilterSetupFlowbits(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
return 0;

SCLogDebug("sgh %p: setting up prefilter", sgh);
struct FBAnalyzer fb_analysis = DetectFlowbitsAnalyzeForGroup(de_ctx, sgh);
struct PrefilterEngineFlowbits *isset_ctx = NULL;
struct PrefilterEngineFlowbits *set_ctx = NULL;
struct FBAnalyzer fb_analysis = DetectFlowbitsAnalyzeForGroup(de_ctx, sgh);
if (fb_analysis.array == NULL)
goto error;

for (uint32_t i = 0; i < sgh->init->sig_cnt; i++) {
Signature *s = sgh->init->match_array[i];