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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1272453002: Fix NavController buffer overflow found by IPC fuzzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index df3413c8d9574185287dc1862b509fc7a3c04671..05faf3b0e6e3e42611785efbbbd78ee34df91129 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1627,8 +1627,7 @@ void NavigationControllerImpl::InsertOrReplaceEntry(
int current_size = static_cast<int>(entries_.size());
// When replacing, don't prune the forward history.
- if (replace) {
- DCHECK_GT(current_size, 0);
+ if (replace && current_size > 0) {
int32 page_id = entry->GetPageID();
// ScopedVectors don't automatically delete the replaced value, so make sure
@@ -1642,6 +1641,9 @@ void NavigationControllerImpl::InsertOrReplaceEntry(
return;
}
+ // We shouldn't see replace == true when there's no committed entries.
+ DCHECK(!replace);
+
if (current_size > 0) {
// Prune any entries which are in front of the current entry.
// last_committed_entry_index_ must be updated here since calls to
« 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