-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Open
Labels
inspectorIssues and PRs related to the V8 inspector protocolIssues and PRs related to the V8 inspector protocol
Description
@nodejs/cpp-reviewers
The data guarded by this critical section may be read while in an inconsistent state or modified by multiple racing threads.
In
node::inspector::MainThreadInterface::DispatchMessages()
: Checking the value of a thread-shared field outside of a locked region to determine if a locked operation involving that thread shared field has completed. (CWE-543)
node/src/inspector/main_thread_interface.cc
Lines 242 to 263 in a08129c
void MainThreadInterface::DispatchMessages() { | |
if (dispatching_messages_) | |
return; | |
dispatching_messages_ = true; | |
bool had_messages = false; | |
do { | |
if (dispatching_message_queue_.empty()) { | |
Mutex::ScopedLock scoped_lock(requests_lock_); | |
requests_.swap(dispatching_message_queue_); | |
} | |
had_messages = !dispatching_message_queue_.empty(); | |
while (!dispatching_message_queue_.empty()) { | |
MessageQueue::value_type task; | |
std::swap(dispatching_message_queue_.front(), task); | |
dispatching_message_queue_.pop_front(); | |
v8::SealHandleScope seal_handle_scope(agent_->env()->isolate()); | |
task->Call(this); | |
} | |
} while (had_messages); | |
dispatching_messages_ = false; | |
} |
Metadata
Metadata
Assignees
Labels
inspectorIssues and PRs related to the V8 inspector protocolIssues and PRs related to the V8 inspector protocol