mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
Add btests for new functionality
- Expand language.set to cover sets of sets - Expand language.table to cover tables indexed with tables - Add language.table-nested-set-ordering to capture the reproducer from GHI-1753
This commit is contained in:
parent
10e8d36340
commit
cfcf1f83cc
7 changed files with 58 additions and 0 deletions
25
testing/btest/language/table-nested-set-ordering.zeek
Normal file
25
testing/btest/language/table-nested-set-ordering.zeek
Normal file
|
@ -0,0 +1,25 @@
|
|||
# This testcase used to cause subtle memory overflow problems due to deviating
|
||||
# traversal order of the k$a set members. With 4.2, this will trigger an
|
||||
# InternalError due to new bounds-checking. For context, see GHI-1753.
|
||||
#
|
||||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
type Key: record {
|
||||
a: set[string];
|
||||
b: string &optional;
|
||||
c: string &optional;
|
||||
};
|
||||
|
||||
global state: table[Key] of count = {};
|
||||
|
||||
event zeek_init() {
|
||||
|
||||
local k: Key;
|
||||
|
||||
k$a = set("MD5", "SHA1");
|
||||
k$b = "12345678901234567890";
|
||||
|
||||
state[k] = 1;
|
||||
print k;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue