From 62e6e0eb3ce59b769ea7fbfe1f8a1032ca41e3c0 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 5 Jul 2018 10:13:52 +0200 Subject: [PATCH] pcap-file: fix segv on bad pcap format --- src/source-pcap-file-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.47.2