Merge remote-tracking branch 'origin/topic/johanna/file-framework-mime-type-detection'

* origin/topic/johanna/file-framework-mime-type-detection:
  Fix potential mime type detection bug in IRC/FTP file_transferred event
This commit is contained in:
Johanna Amann 2021-03-10 13:00:27 +00:00
commit 1d46bcbb81
3 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,13 @@
4.1.0-dev.316 | 2021-03-10 13:00:27 +0000
* 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. (Johanna Amann, Corelight)
4.1.0-dev.314 | 2021-03-08 18:28:22 -0800
* new "opt" btest alternative (Vern Paxson, Corelight)

View file

@ -1 +1 @@
4.1.0-dev.314
4.1.0-dev.316

View file

@ -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 )