Project

General

Profile

Actions

Optimization #8504

open
SP

detect-engine-analyzer: remove unnecessary check

Optimization #8504: detect-engine-analyzer: remove unnecessary check

Added by Sergey Pinaev 1 day ago. Updated 1 day ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Effort:
Difficulty:
Label:

Description

in EngineAnalysisRules2() there is:
if (smd NULL && mpm_list DETECT_SM_LIST_PMATCH) {
smd = s->sm_arrays[mpm_list];
}
do {
switch (smd->type) {
this should be replaced with something like:
if (smd == NULL) {
DEBUG_VALIDATE_BUG_ON(mpm_list != DETECT_SM_LIST_PMATCH);
smd = s->sm_arrays[mpm_list];
}
do {
switch (smd->type) {
because if smd is NULL but mpm_list != DETECT_SM_LIST_PMATCH there will be null pointer
dereference at switch (smd->type).

Actions

Also available in: PDF Atom