mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix potential mime type detection bug in IRC/FTP file_transferred event
The files framework uses strncpy to copy data into the buffer that is used for IRC/FTP mime type detection. From all I can tell that means that, in these cases, currently mime type detection will be messed up if the data being passed in contains zero bytes.
This commit is contained in:
parent
f2d3bf3037
commit
fa4d654a01
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ void File_Analyzer::DeliverStream(int len, const u_char* data, bool orig)
|
|||
|
||||
if ( n )
|
||||
{
|
||||
strncpy(buffer + buffer_len, (const char*) data, n);
|
||||
memcpy(buffer + buffer_len, (const char*) data, n);
|
||||
buffer_len += n;
|
||||
|
||||
if ( buffer_len == BUFFER_SIZE )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue