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

Unified Diff: ui/base/clipboard/scoped_clipboard_writer.cc

Issue 199763002: Verify FormatType in ScopedClipboardWriter::WritePickledData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux GTK Created 6 years, 9 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 | « ui/base/clipboard/clipboard_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/scoped_clipboard_writer.cc
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
index 380b8d2fb848bdb9f012ed0595df1371124e449b..884e5f71a6fe6cd770817f1602fc17dc2ee6e58d 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -91,6 +91,10 @@ void ScopedClipboardWriter::WriteWebSmartPaste() {
void ScopedClipboardWriter::WritePickledData(
const Pickle& pickle, const Clipboard::FormatType& format) {
+ // |format| may originate from the renderer, so sanity check it.
+ if (!Clipboard::IsRegisteredFormatType(format))
+ return;
+
std::string format_string = format.Serialize();
Clipboard::ObjectMapParam format_parameter(format_string.begin(),
format_string.end());
« no previous file with comments | « ui/base/clipboard/clipboard_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698