mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Enforce data size limit when checking files for MIME matches.
The value of *bof_buffer_size* in the *fa_file* record was supposed to always limit the amount of data used by the signature matching engine, but some corner cases would cause matching to be performed on data beyond that.
This commit is contained in:
parent
bc5c02cb74
commit
8126f06ffb
2 changed files with 5 additions and 4 deletions
|
@ -283,6 +283,7 @@ bool File::BufferBOF(const u_char* data, uint64 len)
|
|||
bool File::DetectMIME(const u_char* data, uint64 len)
|
||||
{
|
||||
RuleMatcher::MIME_Matches matches;
|
||||
len = min(len, LookupFieldDefaultCount(bof_buffer_size_idx));
|
||||
file_mgr->DetectMIME(data, len, &matches);
|
||||
|
||||
if ( matches.empty() )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue