mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

Ran into this when using to_port(getenv(...)) for an undefined/empty environment variable. ASAN doesn't like that the slash variable ends up being access behind the string.
24 lines
536 B
Text
24 lines
536 B
Text
#
|
|
# @TEST-EXEC: zeek -b %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
event zeek_init()
|
|
{
|
|
print to_port("123/tcp");
|
|
print to_port("123/udp");
|
|
print to_port("123/icmp");
|
|
print to_port("0/tcp");
|
|
print to_port("0/udp");
|
|
print to_port("0/icmp");
|
|
print to_port("not a port");
|
|
print to_port("");
|
|
print to_port("123");
|
|
print to_port("123/");
|
|
|
|
local a: transport_proto = tcp;
|
|
local b: transport_proto = udp;
|
|
local c: transport_proto = icmp;
|
|
print count_to_port(256, a);
|
|
print count_to_port(256, b);
|
|
print count_to_port(256, c);
|
|
}
|