"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/service_inspectors/wizard/magic.cc" between
snort3-3.1.29.0.tar.gz and snort3-3.1.30.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

magic.cc  (snort3-3.1.29.0):magic.cc  (snort3-3.1.30.0)
skipping to change at line 32 skipping to change at line 32
#endif #endif
#include "magic.h" #include "magic.h"
#include <cassert> #include <cassert>
MagicPage::MagicPage(const MagicBook& b) : book(b) MagicPage::MagicPage(const MagicBook& b) : book(b)
{ {
for ( int i = 0; i < 256; ++i ) for ( int i = 0; i < 256; ++i )
next[i] = nullptr; next[i] = nullptr;
any = nullptr; any = nullptr;
} }
MagicPage::~MagicPage() MagicPage::~MagicPage()
{ {
for ( int i = 0; i < 256; ++i ) for ( int i = 0; i < 256; ++i )
{ {
if ( next[i] && next[i] != this ) if ( next[i] and next[i] != this )
delete next[i]; delete next[i];
} }
delete any; delete any;
} }
const char* MagicBook::find_spell(const uint8_t* data, unsigned len, const char* MagicBook::find_spell(const uint8_t* data, unsigned len,
const MagicPage*& p, const MagicPage*& bookmark) const const MagicPage*& p, const MagicPage*& bookmark) const
{ {
assert(p); assert(p);
p = find_spell(data, len, p, 0, bookmark); p = find_spell(data, len, p, 0, bookmark);
return p ? p->value : nullptr; return p ? p->value : nullptr;
} }
MagicBook::MagicBook() MagicBook::MagicBook()
{ root = new MagicPage(*this); } { root = new MagicPage(*this); }
MagicBook::~MagicBook() MagicBook::~MagicBook()
{ delete root; } { delete root; }
 End of changes. 4 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)