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

Unified Diff: chrome/browser/dom_ui/chrome_url_data_manager.cc

Issue 2829028: Prevent hitting DCHECK when multiple slashes are specified in chrome://devtoo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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/dom_ui/chrome_url_data_manager.cc
===================================================================
--- chrome/browser/dom_ui/chrome_url_data_manager.cc (revision 50559)
+++ chrome/browser/dom_ui/chrome_url_data_manager.cc (working copy)
@@ -169,6 +169,13 @@
if (i == Singleton<ChromeURLDataManager>()->file_sources_.end())
return false;
+ // Check that |relative_path| is not an absolute path (otherwise AppendASCII()
+ // will DCHECK). The awkward use of StringType is because on some systems
+ // FilePath expects a std::string, but on others a std::wstring.
+ FilePath p(FilePath::StringType(relative_path.begin(), relative_path.end()));
+ if (p.IsAbsolute())
+ return false;
+
*file_path = i->second.AppendASCII(relative_path);
return true;
« 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