diff --git a/src/detect-filestore.c b/src/detect-filestore.c index a4bdc249d2bf..c2d1340c22a9 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -209,10 +209,11 @@ static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx, #endif } - /* set filestore depth for stream reassembling */ - TcpSession *ssn = (TcpSession *)p->flow->protoctx; - TcpSessionSetReassemblyDepth(ssn, FileReassemblyDepth()); - + if (p->proto == IPPROTO_TCP && p->flow->protoctx != NULL) { + /* set filestore depth for stream reassembling */ + TcpSession *ssn = (TcpSession *)p->flow->protoctx; + TcpSessionSetReassemblyDepth(ssn, FileReassemblyDepth()); + } if (p->flowflags & FLOW_PKT_TOCLIENT) flags |= STREAM_TOCLIENT; else