]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pcap-file: fix segv on bad pcap format
authorVictor Julien <victor@inliniac.net>
Thu, 5 Jul 2018 08:13:52 +0000 (10:13 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 13 Jul 2018 07:10:28 +0000 (09:10 +0200)
src/source-pcap-file-helper.c

index 7a4f67803d0f1072cdb9e6d7e9f373a2e302feaa..d861f7ee1b77098969728243fabd3ac517d7f8ec 100644 (file)
@@ -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,