fix bug in fileext and filename preventing negated match to work
correctly. Previously, negated fileext (such as !"php") would cause a
match anyway on files that have extension php, as the last if would not
be accessed.
Using the same workflow as detect-filemagic we remove the final
isolated if and set it as a branch of the previous if.
ret = 1;
SCLogDebug("File ext found");
}
- }
-
- if (ret == 0 && (fileext->flags & DETECT_CONTENT_NEGATED)) {
+ } else if (fileext->flags & DETECT_CONTENT_NEGATED) {
SCLogDebug("negated match");
ret = 1;
}
}
}
- if (ret == 0 && (filename->flags & DETECT_CONTENT_NEGATED)) {
+ else if (filename->flags & DETECT_CONTENT_NEGATED) {
SCLogDebug("negated match");
ret = 1;
}