* \note flow is not locked at this time
*/
static int DetectFileInspect(ThreadVars *tv, DetectEngineThreadCtx *det_ctx,
- Flow *f, Signature *s, uint8_t flags, FileContainer *ffc)
+ Flow *f, Signature *s, const SigMatch *smi, uint8_t flags, FileContainer *ffc)
{
- SigMatch *sm = NULL;
+ const SigMatch *sm = NULL;
int r = 0;
int match = 0;
int store_r = 0;
}
/* run the file match functions. */
- for (sm = s->sm_lists[DETECT_SM_LIST_FILEMATCH]; sm != NULL; sm = sm->next) {
+ for (sm = smi; sm != NULL; sm = sm->next) {
SCLogDebug("sm %p, sm->next %p", sm, sm->next);
if (sigmatch_table[sm->type].FileMatch != NULL) {
} else {
/* if we have a filestore sm with a scope > file (so tx, ssn) we
* run it here */
- sm = s->sm_lists[DETECT_SM_LIST_FILEMATCH];
+ sm = smi;
if (sm != NULL && sm->next == NULL && sm->type == DETECT_FILESTORE &&
sm->ctx != NULL)
{
else
ffc = htp_state->files_ts;
- int match = DetectFileInspect(tv, det_ctx, f, s, flags, ffc);
+ int match = DetectFileInspect(tv, det_ctx, f, s, sm, flags, ffc);
if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) {
r = DETECT_ENGINE_INSPECT_SIG_MATCH;
} else if (match == DETECT_ENGINE_INSPECT_SIG_CANT_MATCH) {
else
goto end;
- int match = DetectFileInspect(tv, det_ctx, f, s, flags, ffc);
+ int match = DetectFileInspect(tv, det_ctx, f, s, sm, flags, ffc);
if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) {
r = DETECT_ENGINE_INSPECT_SIG_MATCH;
} else if (match == DETECT_ENGINE_INSPECT_SIG_CANT_MATCH) {