Reviewers: Mads Ager,

Description:
Check for valid frame number when processing the debugger frame request.

BUG=1250705

Please review this at http://codereview.chromium.org/18492

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/debug-delay.js


Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js  (revision 1115)
+++ src/debug-delay.js  (working copy)
@@ -1366,7 +1366,12 @@
    }

    // With no arguments just keep the selected frame.
-  if (request.arguments && request.arguments.number >= 0) {
+  if (request.arguments) {
+    index = request.arguments.number;
+    if (index < 0 || this.exec_state_.frameCount() <= index) {
+      return response.failed('Invalid frame number');
+    }
+
      this.exec_state_.setSelectedFrame(request.arguments.number);
    }
    response.body = this.exec_state_.frame();



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to