Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1484)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp

Issue 1867903002: [DevTools] Fix crash when runtime.evaluate is called with contextId = 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-evaluate-with-context-id-equal-zero-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
index 70eeef743bccd7777126dc9be45455c501a263fe..78f081c67cddd600f1470f0bd35622ab6affa79e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
@@ -89,6 +89,11 @@ void V8InspectorSessionImpl::discardInjectedScripts()
InjectedScript* V8InspectorSessionImpl::findInjectedScript(ErrorString* errorString, int contextId)
{
+ if (!contextId) {
+ *errorString = "Invalid context id: 0";
dgozman 2016/04/07 17:59:09 Cannot find context with specified id
kozy 2016/04/07 18:07:33 Done.
+ return nullptr;
+ }
+
const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_contextGroupId);
if (!contexts || !contexts->contains(contextId)) {
*errorString = "Inspected frame has gone";
dgozman 2016/04/07 17:59:09 Cannot find context with specified id
kozy 2016/04/07 18:07:33 Done.
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-evaluate-with-context-id-equal-zero-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698