From: Victor Julien Date: Thu, 24 Oct 2019 12:51:48 +0000 (+0200) Subject: filestore: don't assume flow is TCP X-Git-Tag: suricata-5.0.1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0824b0413455b668777e83cabe9fbc0ea81c400a;p=thirdparty%2Fsuricata.git filestore: don't assume flow is TCP Filestore can be used by UDP based protocols as well. NFSv2 is one that Suricata supports. Bug #3277. --- diff --git a/src/detect-filestore.c b/src/detect-filestore.c index a4bdc249d2..c2d1340c22 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