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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_api.cc

Issue 186343003: Fix index out of bounds bug which causes memory leak or browser crash in extension sessions API. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/sessions/sessions_api.cc
===================================================================
--- chrome/browser/extensions/api/sessions/sessions_api.cc (revision 254429)
+++ chrome/browser/extensions/api/sessions/sessions_api.cc (working copy)
@@ -228,8 +228,10 @@
int tab_index,
int selected_index) {
std::string session_id = SessionId(session_tag, tab.tab_id.id()).ToString();
+ int index_corrected = std::min(tab.current_navigation_index,
+ static_cast<int>(tab.navigations.size() - 1));
return CreateTabModelHelper(GetProfile(),
- tab.navigations[tab.current_navigation_index],
+ tab.navigations[index_corrected],
not at google - send to devlin 2014/03/07 21:21:45 it looks like you can use tab.normalized_navigatio
session_id,
tab_index,
tab.pinned,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698