mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
FileAnalysis: load custom mime magic database just once.
This works around a bug in libmagic since version 5.12 (current at time of writing is 5.14) -- second call to magic_load() w/ non-default database segfaults.
This commit is contained in:
parent
d22f30e9a1
commit
0141f51801
7 changed files with 15 additions and 32 deletions
|
@ -6,7 +6,6 @@
|
|||
#include "TCP.h"
|
||||
|
||||
#include <string>
|
||||
#include <magic.h>
|
||||
|
||||
class File_Analyzer : public TCP_ApplicationAnalyzer {
|
||||
public:
|
||||
|
@ -31,9 +30,6 @@ protected:
|
|||
static const int BUFFER_SIZE = 1024;
|
||||
char buffer[BUFFER_SIZE];
|
||||
int buffer_len;
|
||||
|
||||
static magic_t magic;
|
||||
static magic_t magic_mime;
|
||||
};
|
||||
|
||||
class IRC_Data : public File_Analyzer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue