mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix potential heap-use-after-free access
This commit is contained in:
parent
202c5dc007
commit
146707d10d
1 changed files with 7 additions and 1 deletions
|
@ -964,7 +964,13 @@ void Manager::Process()
|
|||
|
||||
try
|
||||
{
|
||||
DispatchMessage(topic, broker::move_data(message));
|
||||
// Once we call a broker::move_* function, we force Broker to
|
||||
// unshare the content of the message, i.e., copy the content to a
|
||||
// different memory region if other threads keep references to the
|
||||
// message. Since `topic` still points into the original memory
|
||||
// region, we may no longer access it after this point.
|
||||
auto unshared_topic = broker::move_topic(message);
|
||||
DispatchMessage(unshared_topic, broker::move_data(message));
|
||||
}
|
||||
catch ( std::runtime_error& e )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue