From: Victor Julien Date: Thu, 5 Jul 2018 08:13:52 +0000 (+0200) Subject: pcap-file: fix segv on bad pcap format X-Git-Tag: suricata-4.1.0-rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62e6e0eb3ce59b769ea7fbfe1f8a1032ca41e3c0;p=thirdparty%2Fsuricata.git pcap-file: fix segv on bad pcap format --- diff --git a/src/source-pcap-file-helper.c b/src/source-pcap-file-helper.c index 7a4f67803d..d861f7ee1b 100644 --- a/src/source-pcap-file-helper.c +++ b/src/source-pcap-file-helper.c @@ -41,7 +41,7 @@ void CleanupPcapFileFileVars(PcapFileFileVars *pfv) pfv->pcap_handle = NULL; } if (pfv->filename != NULL) { - if (pfv->shared->should_delete) { + if (pfv->shared != NULL && pfv->shared->should_delete) { SCLogDebug("Deleting pcap file %s", pfv->filename); if (unlink(pfv->filename) != 0) { SCLogWarning(SC_ERR_PCAP_FILE_DELETE_FAILED,