GH-161: fix segfault in &default type checking for sets

Fixes GH-161
This commit is contained in:
Jon Siwek 2019-01-14 14:01:00 -06:00
parent 02783692d8
commit cada0d5e6e
5 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,8 @@
2.6-67 | 2019-01-14 14:01:00 -0600
* GH-161: fix segfault in &default type checking for sets (Jon Siwek, Corelight)
2.6-66 | 2019-01-14 10:26:47 -0600
* Fix performance issue due to variable reuse in table expiration (Justin Azoff, Corelight)

View file

@ -1 +1 @@
2.6-66
2.6-67

View file

@ -292,6 +292,7 @@ void Attributes::CheckAttr(Attr* a)
}
a->AttrExpr()->Error("&default value has inconsistent type", type);
return;
}
TableType* tt = type->AsTableType();

View file

@ -0,0 +1,2 @@
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.attr-default-global-set-error/attr-default-global-set-error.bro, line 4: arithmetic mixed with non-arithmetic (set[string] and 0)
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.attr-default-global-set-error/attr-default-global-set-error.bro, line 4: &default value has inconsistent type (0 and set[string])

View file

@ -0,0 +1,4 @@
# @TEST-EXEC-FAIL: bro -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
global ss: set[string] &default=0;