Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: check return value for inspector call
Browse files Browse the repository at this point in the history
The return value for JsDiagGetScripts was not being validated and
continuing on during an error condition.
  • Loading branch information
kfarnung committed May 24, 2017
1 parent eb30926 commit 424d2ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deps/chakrashim/src/inspector/v8-debugger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,25 @@ void V8Debugger::getCompiledScripts(
int contextGroupId,
std::vector<std::unique_ptr<V8DebuggerScript>>& result) {
JsValueRef scripts;
JsDiagGetScripts(&scripts);
if (JsDiagGetScripts(&scripts) != JsNoError) {
assert(false);
return;
}

int length;
int length = 0;
if (jsrt::InspectorHelpers::GetIntProperty(scripts, "length", &length) != JsNoError) {
assert(false);
return;
}

for (int i = 0; i < length; i++) {
JsValueRef index;
JsValueRef index = nullptr;
if (JsIntToNumber(i, &index) != JsNoError) {
assert(false);
return;
}

JsValueRef script;
JsValueRef script = nullptr;
if (JsGetIndexedProperty(scripts, index, &script) != JsNoError) {
assert(false);
return;
Expand Down

0 comments on commit 424d2ba

Please sign in to comment.