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

Unified Diff: remoting/host/setup/me2me_native_messaging_host.cc

Issue 615543004: Fix remoting NM hosts to verify that incoming messages are dictionaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « remoting/host/native_messaging/pipe_messaging_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/me2me_native_messaging_host.cc
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc
index fc77b9f963e180f404eee4f811aa5dc862c9317f..574a37e3e6ead351f18156eb418cac914be8a0f4 100644
--- a/remoting/host/setup/me2me_native_messaging_host.cc
+++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -104,6 +104,12 @@ void Me2MeNativeMessagingHost::Start(
void Me2MeNativeMessagingHost::OnMessage(scoped_ptr<base::Value> message) {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (message->GetType() != base::Value::TYPE_DICTIONARY) {
+ LOG(ERROR) << "Received a message that's not a dictionary.";
+ channel_->SendMessage(nullptr);
+ return;
+ }
+
scoped_ptr<base::DictionaryValue> message_dict(
static_cast<base::DictionaryValue*>(message.release()));
scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue());
« no previous file with comments | « remoting/host/native_messaging/pipe_messaging_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698