summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/options
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 22:22:17 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 22:22:17 +0000
commit5be424c82a3ea9ec7550a3d2f00bc2ce57a88583 (patch)
treef6901b7c288a281e7388339a1feaac9870ddf53b /chrome/browser/views/options
parent3edd952ea05dfb5c950b63768fc9cc9ec807f6d8 (diff)
downloadchromium_src-5be424c82a3ea9ec7550a3d2f00bc2ce57a88583.zip
chromium_src-5be424c82a3ea9ec7550a3d2f00bc2ce57a88583.tar.gz
chromium_src-5be424c82a3ea9ec7550a3d2f00bc2ce57a88583.tar.bz2
Fix potential crash if the saved options tab is ever out of bounds.
http://crbug.com/8342 Review URL: http://codereview.chromium.org/40090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options')
-rw-r--r--chrome/browser/views/options/options_window_view.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc
index fbe4003..2090c7e 100644
--- a/chrome/browser/views/options/options_window_view.cc
+++ b/chrome/browser/views/options/options_window_view.cc
@@ -117,7 +117,10 @@ void OptionsWindowView::ShowOptionsPage(OptionsPage page,
if (page == OPTIONS_PAGE_DEFAULT)
page = OPTIONS_PAGE_GENERAL;
}
- DCHECK(page > OPTIONS_PAGE_DEFAULT && page < OPTIONS_PAGE_COUNT);
+ // If the page number is out of bounds, reset to the first tab.
+ if (page < 0 || page >= tabs_->GetTabCount())
+ page = OPTIONS_PAGE_GENERAL;
+
tabs_->SelectTabAt(static_cast<int>(page));
GetCurrentOptionsPageView()->HighlightGroup(highlight_group);