mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Fix for CIDs 1402823 and 1394050.
An InterpreterException from clone framing could go uncaught.
This commit is contained in:
parent
0a2d84284c
commit
c38e9b2ff2
2 changed files with 16 additions and 2 deletions
|
@ -128,7 +128,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Performs a deep copy of all the values in the current frame. If
|
* Performs a deep copy of all the values in the current frame. If
|
||||||
* the frame has a closure the returned frame captures that closure
|
* the frame has a closure the returned frame captures that closure
|
||||||
* by reference.. As such, performing a clone operation does not copy
|
* by reference. As such, performing a clone operation does not copy
|
||||||
* the values in the closure.
|
* the values in the closure.
|
||||||
*
|
*
|
||||||
* @return a copy of this frame.
|
* @return a copy of this frame.
|
||||||
|
|
|
@ -218,7 +218,21 @@ bool Trigger::Eval()
|
||||||
// An alternative approach to copying the frame would be to deep-copy
|
// An alternative approach to copying the frame would be to deep-copy
|
||||||
// the expression itself, replacing all references to locals with
|
// the expression itself, replacing all references to locals with
|
||||||
// constants.
|
// constants.
|
||||||
Frame* f = frame->Clone();
|
|
||||||
|
Frame* f = nullptr;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
f = frame->Clone();
|
||||||
|
}
|
||||||
|
catch ( InterpreterException& )
|
||||||
|
{
|
||||||
|
// Frame contains values that couldn't be cloned. It's
|
||||||
|
// already been reported, disable trigger.
|
||||||
|
Disable();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
f->SetTrigger(this);
|
f->SetTrigger(this);
|
||||||
|
|
||||||
Val* v = nullptr;
|
Val* v = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue