BIT-1544: allow NULs in file analysis handles

This commit is contained in:
Jon Siwek 2018-08-15 18:01:56 -05:00
parent f336c8c710
commit 05b10fe2e7
5 changed files with 22 additions and 5 deletions

View file

@ -105,7 +105,9 @@ module GLOBAL;
## .. bro:see:: get_file_handle
function set_file_handle%(handle: string%): any
%{
file_mgr->SetHandle(handle->CheckString());
auto bytes = reinterpret_cast<const char*>(handle->Bytes());
auto h = std::string(bytes, handle->Len());
file_mgr->SetHandle(h);
return 0;
%}