mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Null-terminate the string created by decode_netbios_name BiF.
(initially observed through failures of bifs.netbios-functions unit test)
This commit is contained in:
parent
13c90fc732
commit
d358ef1e71
1 changed files with 4 additions and 1 deletions
|
@ -1348,7 +1348,7 @@ function fmt_ftp_port%(a: addr, p: port%): string
|
||||||
function decode_netbios_name%(name: string%): string
|
function decode_netbios_name%(name: string%): string
|
||||||
%{
|
%{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
char result[32];
|
char result[16];
|
||||||
const u_char* s = name->Bytes();
|
const u_char* s = name->Bytes();
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -1367,8 +1367,11 @@ function decode_netbios_name%(name: string%): string
|
||||||
buf[i] < 3 )
|
buf[i] < 3 )
|
||||||
result[i] = buf[i];
|
result[i] = buf[i];
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
result[i] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new StringVal(result);
|
return new StringVal(result);
|
||||||
%}
|
%}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue