From 938e9b3db01c7736b218f4c0e5b5fd74e2ff310b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 2 Dec 2011 11:37:36 +0100 Subject: [PATCH] Fix filestore related segv. --- src/detect-engine-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detect-engine-file.c b/src/detect-engine-file.c index 7e994ace81..27d989097d 100644 --- a/src/detect-engine-file.c +++ b/src/detect-engine-file.c @@ -155,7 +155,9 @@ static int DetectFileInspect(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, /* 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]; - if (sm != NULL && sm->next == NULL && sm->type == DETECT_FILESTORE) { + if (sm != NULL && sm->next == NULL && sm->type == DETECT_FILESTORE && + sm->ctx != NULL) + { DetectFilestoreData *fd = sm->ctx; if (fd->scope > FILESTORE_SCOPE_DEFAULT) { match = sigmatch_table[sm->type].