diff --git a/src/script_opt/ZAM/Support.cc b/src/script_opt/ZAM/Support.cc index a9c25b2b7d..83d8828351 100644 --- a/src/script_opt/ZAM/Support.cc +++ b/src/script_opt/ZAM/Support.cc @@ -6,6 +6,7 @@ #include "zeek/Desc.h" #include "zeek/Reporter.h" +#include "zeek/ScriptValidation.h" #include "zeek/ZeekString.h" #include "zeek/script_opt/ProfileFunc.h" @@ -33,6 +34,14 @@ bool is_ZAM_compilable(const ProfileFunc* pf, const char** reason) return false; } + auto b = pf->ProfiledBody(); + if ( b && ! script_is_valid(b) ) + { + if ( reason ) + *reason = "invalid script body"; + return false; + } + return true; }