zeek/testing/btest/signatures/bad-eval-condition.bro
Jon Siwek bef0ce1c98 Add type checking for signature 'eval' condition functions.
Otherwise functions could be called with a mismatching argument list
and cause a crash at run-time.  The incorrect function type is now
reported at parse-time.
2012-08-23 11:52:39 -05:00

22 lines
427 B
Text

# @TEST-EXEC-FAIL: bro -r $TRACES/ftp-ipv4.trace %INPUT
# @TEST-EXEC: btest-diff .stderr
@load-sigs blah.sig
@TEST-START-FILE blah.sig
signature blah
{
ip-proto == tcp
src-port == 21
payload /.*/
eval mark_conn
}
@TEST-END-FILE
# wrong function signature for use with signature 'eval' conditions
# needs to be reported
function mark_conn(state: signature_state): bool
{
add state$conn$service["blah"];
return T;
}