summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/host/it2me/it2me_native_messaging_host.cc6
-rw-r--r--remoting/host/native_messaging/pipe_messaging_channel.cc6
-rw-r--r--remoting/host/setup/me2me_native_messaging_host.cc6
3 files changed, 12 insertions, 6 deletions
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index eaede40..e56dd7a 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());
diff --git a/remoting/host/native_messaging/pipe_messaging_channel.cc b/remoting/host/native_messaging/pipe_messaging_channel.cc
index 0f3fe11..399bfa8 100644
--- a/remoting/host/native_messaging/pipe_messaging_channel.cc
+++ b/remoting/host/native_messaging/pipe_messaging_channel.cc
@@ -72,12 +72,6 @@ void PipeMessagingChannel::Start(EventHandler* event_handler) {
void PipeMessagingChannel::ProcessMessage(scoped_ptr<base::Value> message) {
DCHECK(CalledOnValidThread());
- if (message->GetType() != base::Value::TYPE_DICTIONARY) {
- LOG(ERROR) << "Expected DictionaryValue";
- Shutdown();
- return;
- }
-
if (event_handler_)
event_handler_->OnMessage(message.Pass());
}
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc
index bf3684fe..3d6cb3d 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());