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()); |