Skip to content

Commit dacc3c7

Browse files
committed
diagnostics_channel: check arg is uint
1 parent 4b20c09 commit dacc3c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_diagnostics_channel.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void BindingData::NotifyChannelActive(const FunctionCallbackInfo<Value>& args) {
136136
Realm* realm = Realm::GetCurrent(args);
137137
BindingData* binding = realm->GetBindingData<BindingData>();
138138
if (binding == nullptr) return;
139+
CHECK(args[0]->IsUint32());
139140
uint32_t index = args[0].As<v8::Uint32>()->Value();
140141
auto it = binding->channel_status_callbacks_.find(index);
141142
if (it != binding->channel_status_callbacks_.end()) it->second(true);
@@ -146,6 +147,7 @@ void BindingData::NotifyChannelInactive(
146147
Realm* realm = Realm::GetCurrent(args);
147148
BindingData* binding = realm->GetBindingData<BindingData>();
148149
if (binding == nullptr) return;
150+
CHECK(args[0]->IsUint32());
149151
uint32_t index = args[0].As<v8::Uint32>()->Value();
150152
auto it = binding->channel_status_callbacks_.find(index);
151153
if (it != binding->channel_status_callbacks_.end()) it->second(false);

0 commit comments

Comments
 (0)