diff --git a/CHANGES b/CHANGES index e854acd264..e301b42b9b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +7.0.0-dev.143 | 2024-04-22 15:15:55 -0700 + + * Check for valid identifier in WhenStmt::Describe (Tim Wojtulewicz, Corelight) + + * Bump zeek-aux submodule to pull in zeek-archiver addition (Christian Kreibich, Corelight) + + * Remove zeek-archiver from build config, deprecate --disable-archiver in configure (Christian Kreibich, Corelight) + + * Drop zeek-archiver submodule (Christian Kreibich, Corelight) + + zeek-archiver now lives in the zeek-aux submodule. + 7.0.0-dev.136 | 2024-04-18 09:02:14 -0700 * Update core.pcap.filter-warning baseline (Peter Cullen, Corelight) diff --git a/VERSION b/VERSION index 1da60c5828..9b942348fb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.0-dev.136 +7.0.0-dev.143 diff --git a/src/Stmt.cc b/src/Stmt.cc index d2def610c3..453e72cc12 100644 --- a/src/Stmt.cc +++ b/src/Stmt.cc @@ -2029,7 +2029,10 @@ void WhenStmt::StmtDescribe(ODesc* d) const { if ( c.IsDeepCopy() ) d->Add("copy "); - d->Add(c.Id()->Name()); + if ( c.Id() ) + d->Add(c.Id()->Name()); + else + d->Add(""); } d->Add("]"); } diff --git a/testing/btest/Baseline/language.when-local-function-capture-error/out b/testing/btest/Baseline/language.when-local-function-capture-error/out new file mode 100644 index 0000000000..9dd2161419 --- /dev/null +++ b/testing/btest/Baseline/language.when-local-function-capture-error/out @@ -0,0 +1,2 @@ +error in /Users/tim/Desktop/projects/zeek-master/testing/btest/.tmp/language.when-local-function-capture-error/when-local-function-capture-error.zeek, line 9: no such local identifier: z +error in /Users/tim/Desktop/projects/zeek-master/testing/btest/.tmp/language.when-local-function-capture-error/when-local-function-capture-error.zeek, lines 12-16: y is used inside "when" statement but not captured (when [x, ](T == T) { print hmm?, x, y} timeout 100.0 msecs { print timeout}) diff --git a/testing/btest/language/when-local-function-capture-error.zeek b/testing/btest/language/when-local-function-capture-error.zeek new file mode 100644 index 0000000000..199d3ed85f --- /dev/null +++ b/testing/btest/language/when-local-function-capture-error.zeek @@ -0,0 +1,17 @@ +# @TEST-DOC: Tests that a capture in a function that doesn't exist doesn't crash +# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1 +# @TeST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out + +function f() { + local x = 1; + local y = 2; + + when [x, z] ( T == T ) + { + print "hmm?", x, y; + } + timeout 100msec + { + print "timeout"; + } +}