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

Unified Diff: remoting/host/it2me/it2me_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 | « no previous file | remoting/host/native_messaging/pipe_messaging_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index 6fb65df5ec7548a40489fdd78c90cec94bd21009..35d578a7aa2abfde251f31ef9f3ecf42beee01ef 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -87,6 +87,12 @@ void It2MeNativeMessagingHost::Start(const base::Closure& quit_closure) {
void It2MeNativeMessagingHost::OnMessage(scoped_ptr<base::Value> message) {
DCHECK(task_runner()->BelongsToCurrentThread());
+ 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 | « no previous file | remoting/host/native_messaging/pipe_messaging_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698